Bug 84035

Summary: can't correctly select wrapped lines in gnome-terminal
Product: [Retired] Red Hat Linux Reporter: Per Bothner <per>
Component: vteAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:51:42 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:

Description Per Bothner 2003-02-11 07:39:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212

Description of problem:
(This bug is also in Phoebe 8.0.93.)

If a program (like make, say) writes long lines to
a gnome-terminal, you cannot reliably select such
lines and paste them.  It uses the *visual* appearance
of the terminal where a line ends:  If the last
character on the line is a space, then it assumes
the selection should contain a newline, and vice
versa.

This is wrong: gnome-terminal needs to *remember*
for each line whether a cr-nl was emitted or whether
the line overflowed.  Xterm gets this right, at least
most of the time.  (I also got this right in my Emacs
terminal emulator by being careful when I inserted a
newline in the buffer.)

The result is very annoying and unreliable cut-and-paste.

Note that gnome-terminal (like xterm and vt100) has the
termcap 'xn' capability, so you need special handling
at the end of the line anyway.  All you need to do is
maintain a bit for each line whether the line overflowed,
and update when inserting/deleting lines or scrolling.

Ideally, this flag bit should also be used when re-sizing
the terminal, re-breaking long lines.


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


How reproducible:
Always

Steps to Reproduce:
Run 'cat' in gmome-terminal.  Type a line longer than the window
width, making sure the last column on the line is a space.
Now copy this line into an emacs window (useful to
clearly see where the newlines are).
Note how the one line gets split into two.

Next try type a line the width of the window.  End the
line with non-spaces (i.e. the last column is not a space).
Then hit enter just before the line wraps, and then type
some more on the next line.  Then select these two lines,
and paste them into emacs.  Notice how the two lines are
now one long wrapped-around line in emacs.
    

Actual Results:  See description.

Expected Results:  See description.

Additional info:

One can argue whether the serverity is normal or low,
but it is one of the things in RH 8.0 that has most
annoyed me day-to-day.

Note that bug 74611 is related, but different.
The fix for bug 74611 does not handle long lines.

Comment 1 Ray Strode [halfline] 2004-11-09 17:49:24 UTC

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

Comment 2 Red Hat Bugzilla 2006-02-21 18:51:42 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.