Firefox 3 copies newline to clipboard, causes paste problems in other programs




10 years ago
9 years ago


(Reporter: Daryl Blanc, Unassigned)


Firefox Tracking Flags

(Not tracked)





10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9) Gecko/2008061015 Firefox/3.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv: Gecko/2008070206 Firefox/3.0.1

Copying an entire line of text from a text file to other programs on Linux causes the newline at the end to be pasted too. This is not how it worked in Firefox 2.

Reproducible: Always

Steps to Reproduce:
Good Case:
1. Go to
2. Select an entire line by triple clicking
3. Pasting with middle-click paste pastes the line you selected with no extra newline.

Failure Case:
1. Go to
2. Select an entire line by dragging a selection from the left of a line to the right of the line (make sure you move the cursor beyond the last character on the line)
3. Pasting with middle-click paste in gedit pastes the line you selected including a newline at the end.
Actual Results:  
Text pasted with unwanted newline at the end.

Expected Results:  
Text that appeared as selected/highlighted should be pasted, but no newline at the end if the selection did not go over onto the next line.

If you drag to select the entire line being careful to not to move over the end of the last character, the newline is not pasted.

If you drag carelessly and select to a point further to the right of the end of the line of text, the newline will be pasted. In this case on Firefox 2 the newline would still not be printed.

If copying commands and pasting into a terminal this newline at the end causes the command being pasted to be executed immediately, which may not always be wanted if the command needs modified before execution.

Additionally it seems that if pasting to OpenOffice (2.4) the newline is always pasted, but that may be an unrelated OpenOffice bug. The difference in behaviour demonstrated by using gedit proves that Firefox puts different contents on the clipboard depending on how the selection was made. Its important to note that in all cases above it will be the exact same text that appears as highlighted on the page, so the difference in behaviour is confusing and inconsistent.

I mention text files because I can reproduce it 100% of the time with text files, I believe I have seen it in some HTML pages too but not always.

This is related to bug 435704 but the behaviour is different for me (ie you need to select beyond the end of the line), and I cannot reproduce the issue with the HTML file attached to that bug.

Comment 1

10 years ago
It just copys the one line for me.

Does this happen in other programs also or is it limited to Firefox?  If it is only Firefox try safe mode.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008071702 Minefield/3.1a1pre ID:2008071702

Comment 2

10 years ago
It only happens in Firefox (copying the same line in gedit and pasting it again does not result in the same behaviour). Also it is only since Firefox 3.

I just reproduced the same issue on the latest nightly build. I tried both in normal mode and with -safe-mode enabled. I confirmed it on two systems, both running Ubuntu 8.04.1

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008071802 Minefield/3.1a1pre

Comment 3

10 years ago
I have the latest build and I can not reproduce the problem. How far are you going beyond the end of the line?  I went pretty far.  Does it copy right to any program? What about within Firefox?

Comment 4

10 years ago
I just played with how far you have to go past the end of the line. When the mouse cursor is still over the text you are selecting it turns into the I-bar, as soon as you go over the end of the text the cursor changes back to the normal pointer icon.

It seems that the exact pixel where it changes back to the pointer is far enough. I am testing this right now by pasting the first line from your last comment into the "Additional Comments" box at the bottom of this bug report where I'm typing this and it is happening here, IF I move the mouse to the right of the line of text (cursor turns to pointer) before I release the mouse button when selecting.

I also just pasted the same line into chat windows in Skype and Pidgin, and the extra line appeared on both of those too.

I have spoken to a few other people in work who have also noticed the same problem separately, I'll try to get them to put some details in about their setup in the next few days. What OS are you using Myles? Possibly it only occurs on Ubuntu? If I can provide any other details about my setup please let me know so we can narrow down the cause, thanks for looking into this.

Comment 5

10 years ago
I am using Ubuntu, 1.9.1a1pre, that might be the difference.

Comment 6

10 years ago
I'm confused, I don't see a difference in that version number to mine, here is mine again:

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008071802

I got it this morning (18/July/2008) from here:

This is the exact link I downloaded:

Comment 7

10 years ago
You are looking at the Firefox version.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008071702 Minefield/3.1a1pre ID:2008071702

Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:
Gecko/2008070206 Firefox/3.0.1

See my rv: is 1.9.1a1pre. That means I am running 1.9.1 alpha 1 pre-release. While you are just running

We are both running the same version of Firefox.

Comment 8

10 years ago
Sorry. Yes that's what I posted originally, but today I have reproduced the problem on the latest nightly (see comment #2) which also says "rv:1.9.1a1pre" in the version string.

Comment 9

10 years ago
I can reproduce this on OpenSolaris and MacOS. So change the bug to New 

But on Windows, it works. 
Ever confirmed: true

Comment 10

10 years ago
so Daryl, you are running Ubuntu 1.9.1a1pre?

Comment 11

10 years ago
ok, rv is something different.

To summarize, Daryl can reproduce on 3.1a1pre, emily can reproduce on OpenSolaris and MAC, and I can't reproduce.

Comment 12

10 years ago
I can reproduce the issue on the Ubuntu 8.04.1 Live CD (i386). I used the Firefox version (3.0) that is installed on that. I also tried to reproduce on the livecd with the latest downloaded nightly but it wouldn't run for me. The livecd might be a way you can reproduce it Myles because the environment is identical for us all then.

Comment 13

10 years ago
I have some friends on Ubuntu and I will see if they can reproduce also.

If it only happens on the Live CD, then it is a setting change.  One that I have changed and that you didn't.

Emily: Did you change any settings or was it a fresh install?

Comment 14

10 years ago
Hi Myles,
Its not only on the LiveCD, I tried it that way additionally to see if it would help you reproduce it. It has happened to me consistently on at least 2 different (long standing) installs plus the livecd. I have not seen an Ubuntu/Firefox 3 installation where it didn't happen.

Comment 15

10 years ago
Right, I understand that. What I am saying is that maybe I changed a setting and you didn't. I am not sure what that setting would be, but that would be the only difference in our computers. 

Can you please try a new profile.

Comment 16

10 years ago
I've just tried the latest nightly (version string below) with a newly created profile. I ran ./firefox -ProfileManager to create a new one. I didn't change any setting or preferences in the new profile before I tested. The result is the same.

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008072102 Minefield/3.1a1pre

Comment 17

10 years ago
The bug can be reproduced in Firefox3 under OpenSolaris, Windows, Ubuntu, Solaris, and Firefox2 under all above OS does not have the bug, so changed OS to All. 
OS: Linux → All
You need to log in before you can comment on or make changes to this bug.