Bug 77623 - cut-and-paste adds extra newlines
cut-and-paste adds extra newlines
Status: CLOSED DUPLICATE of bug 75904
Product: Red Hat Linux
Classification: Retired
Component: vte (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ray Strode [halfline]
Depends On:
Blocks: 79579 CambridgeTarget
  Show dependency treegraph
Reported: 2002-11-11 00:15 EST by Jason Merrill
Modified: 2007-04-18 12:48 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-10 15:39:46 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jason Merrill 2002-11-11 00:15:22 EST
Description of Problem:

if the text i select in gnome-terminal has a space at the end of a line, cutting
and pasting it adds a newline at the end of that line, even if the text was
originally output on a single line.  This breaks cutting and pasting of command

Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. Type 'aaaaaaaaa...' up to one character before the end of the terminal row.
2. Hit the space bar a couple of times, then add some more aaaaaaaaaa's.
3. Cut and paste this long line.

Actual Results:

It is pasted as two lines.

Expected Results:

It should be pasted as a single line, since it was entered as a single line.

Additional Information:
This happens both with select/middle-click and with cut/paste from the
right-click menu.
Comment 1 Nakai 2002-11-25 01:14:33 EST
A customer reported a similar example today.
(So I filed it here)

'aaa bbb ccc'
in a line and select 'aaa ' (include space)
and paste. It will paste 'aaa' and a new line.
Comment 2 Nalin Dahyabhai 2003-01-13 23:14:15 EST
Should be fixed in Raw Hide.  Please reopen if you find that this is not the case.
Comment 3 Jason Merrill 2003-06-26 16:24:23 EDT
ynakai's testcase is fixed in Shrike, but mine is not.
Comment 4 John Gotts 2003-11-13 13:48:53 EST
vte inserts newline characters where none existed and omits them where
they did exist.

The former situation occurs when there are one or more spaces at the
end of a physical line but in the middle of a virtual line.  The
latter occurs when a logical line exactly matches the length of a
physical line.

Let's say I bring up a gnome-terminal with a 10-character width.  I
type in the string "123456789 123456789" which will display as:


Pasting the string to another gnome-terminal will result in the string
getting broken in the middle.

Let's say I enter the string "1234567890" and then enter the string
"123456789" which will display as:


Now gnome-terminal will join the result on a cut and paste where there
should have been a newline.

This behavior is not just annoying but causes me to waste a lot of
time repairing damage.  When a simple rpm --upgrade would suffice, I
find I have to carefully paste things while studying how the command
spans lines.  When I'm root I like to check my commands before
executing.  But with the newline-insertion behavior, I've gotten a few
surprises.  Luckily I haven't lost any important data.
Comment 5 Ray Strode [halfline] 2004-11-10 15:39:46 EST
The former case has been fixed and the latter is filed as bug 75904

*** This bug has been marked as a duplicate of 75904 ***

Note You need to log in before you can comment on or make changes to this bug.