After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780011 - Weird bash line editing and soft vs hard newline issue
Weird bash line editing and soft vs hard newline issue
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
git master
Other Linux
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-14 00:27 UTC by Egmont Koblinger
Modified: 2017-03-20 21:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
typescript (1.05 KB, text/plain)
2017-03-14 00:27 UTC, Egmont Koblinger
  Details
Fix (532 bytes, patch)
2017-03-14 20:59 UTC, Egmont Koblinger
none Details | Review

Description Egmont Koblinger 2017-03-14 00:27:59 UTC
Created attachment 347896 [details]
typescript

bash-4.3.46 on Ubuntu Yakkety, I execute three commands:

First: echo http://foo.example.com

Second: A command that's long enough to wrap to two lines while I type it

Third: Press the Up arrow twice to re-echo the URL

At the first command, the URLs (both the one I typed and the one echoed back) behave as expected on mouseover.

At the last command, the URL I typed is underlined on hover along with the next line's "http", and the rest of the echoed back URL is never highlighted.

Also, on a window resize (rewrap) these two lines becomes joined together. So basically vte thinks it's a soft linewrap near the middle of the line.

Instead of reproducing with bash, you can just as well cat the attached typescript with the standard 80 columns.

We should examine what's going on and whether VTE can be improved here. E.g. I can see a "\e36P" (delete 36 characters from the right) in the typescript, this is really suspicious. Maybe seeing such a character should change the line to be hard wrapped. Maybe this would also improve the experience of zsh users (they tend to see lots of artifacts due to rewrap on resize).
Comment 1 Egmont Koblinger 2017-03-14 20:57:59 UTC
I've checked xterm and indeed it's different here: an \e[P switches the current line to hard wrapped. Makes sense, we should do it too. (Note: that's what both xterm and vte does on \e[K.)

(I don't know if xterm can do auto-highlight of URLs, but copy-pasting as well as triple click reveals the hard vs. soft line ending.)
Comment 2 Egmont Koblinger 2017-03-14 20:59:56 UTC
Created attachment 347951 [details] [review]
Fix
Comment 3 Egmont Koblinger 2017-03-20 21:37:13 UTC
Committed to master (aka. 0-49).