Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 450554

Summary: Pasting large texts into bash will drop some characters
Product: Gentoo Linux Reporter: Chen Yabo <321cyb>
Component: [OLD] Core systemAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kripton
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://lkml.org/lkml/2009/10/19/2
Whiteboard:
Package list:
Runtime testing required: ---

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?