Bug 72050 - Pasting long things into terminals (xedit, gnome-terminal, konsole) results in corruption
Summary: Pasting long things into terminals (xedit, gnome-terminal, konsole) results i...
Status: CLOSED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium major
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-26 20:11 UTC by Andy Lutomirski
Modified: 2018-06-18 21:56 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Testcast that reproduces this bug (4.73 KB, text/plain)
2013-11-26 20:11 UTC, Andy Lutomirski
no flags Details

Description Andy Lutomirski 2013-11-26 20:11:33 UTC
Created attachment 89857 [details]
Testcast that reproduces this bug

This bug is really weird.  I'm not sure it's an xserver bug, but I can't imagine what else causes it, so here goes.  If it's not an xserver bug, please point me in the right direction.

If I paste long files into a terminal, *really* weird things happen.  For example, if I paste the attached file into a terminal running "cat", the last line does not appear.  If I press enter after pasting, the enter shows up, then the last line, then enter again.  If I press paste, then 'f', then enter, then the 'f' shows up twice (!).  It looks like this:

(1),
(1),
(2),
f
(1),(1);f
        ^
     completely bogus second 'f'


By "paste", I mean any of:
 - select text from emacs and middle-click into xterm
 - copy text (to the clipboard selection or whatever the "copy-and-paste" clipboard is called) from kate or emacs and paste (using the edit menu) into gnome-terminal.
 - copy text and paste into konsole

I've seen this in GNOME and KDE on multiple versions of Fedora and Ubuntu.  It's not quite 100% reproducible, but it's rather reliably broken.
Comment 1 Adam Jackson 2018-06-13 18:23:04 UTC
That's not bogus? I don't know why cat has refused to print the trailing (1),(1); by the time you hit f, but once it does, it also has to print the f you just typed.
Comment 2 Andy Lutomirski 2018-06-18 21:56:26 UTC
Hmm, this may indeed just be a race, and the evidence scrolled off the screen.  If I do:

$ tail -n10 testcase.txt |xsel -ib
$ cat

and hit paste, f, enter, I see:

$ cat
(1),
(1),
(1),
(1),
(1),
(1),
(1),
(1),
(2),
(1),(1);(1),
(1),
(1),
(1),
(1),
(1),
(1),
(1),
(2),
f
(1),(1);f

so there is just a bunch of output from cat that pushed the evidence of what happened off the screen.  So maybe all is well.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.