Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 450554 - Pasting large texts into bash will drop some characters
Summary: Pasting large texts into bash will drop some characters
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: https://lkml.org/lkml/2009/10/19/2
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-06 16:21 UTC by Chen Yabo
Modified: 2013-01-07 04:17 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Yabo 2013-01-06 16:21:37 UTC
If you have 2000 lines of "123456789\n"in the system clipboard, then you open Konsole or Gnome Terminal, use here document to write the content of clipboard to another file:
bash-prompt $ cat > output << EOF
then paste system clipboard contents to Konsole or Gnome Terminal, and then type EOF. you will find the output file is not the same as the clipboard.

Reproducible: Always

Steps to Reproduce:
1.copy large texts
2.paste to Konsole or Gnome Terminal as here document
Actual Results:  
The output file will actually consists several lines which are "012" not "0123456789".

Expected Results:  
All lines are "0123456789"

After searching Google, I find this actually is a bug in Linux Kernel, see this mail from LKML: https://lkml.org/lkml/2009/10/19/2.
Simply speaking, the reason is that kernel doesn't handle "n_tty buffer full" and "canonical mode change" very well, It's probably hard to fix the problem in kernel, but I think we should provide a workaround in Konsole or Gnome Terminal, here's a possible solution which is taken by a Mac Terminal Emulator: http://code.google.com/p/iterm2/issues/detail?id=1031&can=1&q=too%20fast
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-01-07 04:17:49 UTC
If upstream has been slacking about this for 4 years, then how should downstream Gentoo fix it for them?