Attached is a patch that addresses the issue of lost character echos during program output and in a stopped tty. The patch adds an "echo buffer" to N_TTY that handles all ldisc-generated output (including echoed characters). The main thing this solves is the loss of characters when they cannot be immediately written to the tty driver. Highlights are: * ^C (and other chars) are no longer lost when write buffer is full - (often happens with continuous program output) * Character echoes are not lost when tty is in stopped state (e.g. ^S) - (e.g.: ^Q will cause held characters to be output) * When echoing control char pairs (e.g. "^C"), ensure pair stays together The echo buffer stores characters as well as operations that need to be done in sync with character output (like management of the column position). This allows it to play well with the interleaved program output. I am currently testing the patch on a couple of systems, but it looks good so far. Note that this patch currently applies cleanly to 2.6.26 and with offsets to 2.6.27 (but I have not tested yet on the latter - should work, though). -Joe