Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 77623

Summary: cut-and-paste adds extra newlines
Product: [Retired] Red Hat Linux Reporter: Jason Merrill <jason>
Component: vteAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: hfuchi, jgotts
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-10 20:39:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 79579, 100644    

Description Jason Merrill 2002-11-11 05:15:22 UTC
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
lines.

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

2.0.1-5

How Reproducible:

always

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 06:14:33 UTC
A customer reported a similar example today.
(So I filed it here)

Input
'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-14 04:14:15 UTC
Should be fixed in Raw Hide.  Please reopen if you find that this is not the case.

Comment 3 Jason Merrill 2003-06-26 20:24:23 UTC
ynakai's testcase is fixed in Shrike, but mine is not.

Comment 4 John Gotts 2003-11-13 18:48:53 UTC
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:

123456789
123456789

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:

1234567890
123456789

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 20:39:46 UTC
Hi,
The former case has been fixed and the latter is filed as bug 75904


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