Is typeahead loss a generic ksh problem?

David Elliott dce at mips.COM
Thu May 19 01:13:24 AEST 1988


(I apologize if this is a repost.  I looked, and it doesn't appear to
 have gone out, but flakiness is flakiness.)

In article <8062 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
>We're using the 02/21/85b version of ksh on a VAX 11/750 running MORE/bsd 4.3.
>At times ksh will flush typeahead, as shown by the transcript below:

Typeahead flush is a problem with most line-editors, which is one of
the reasons it is preferable to implement line-editors in the tty
instead of in the shells.  When you change from standard (cooked) mode
to raw or pseudo-raw mode, you lose the data.

A similar problem exists with the Livermore csh line-editor and is likely
to exist in tcsh.  It does not exist in the old BSD command completion
interface, which uses alternate break characters and TIOCSTI.

What can happen is that either typeahead gets flushed, or it gets
eaten by the editor.  For example, if you type the lines

	sleep 20
	head -1
	echo foo
	echo bar

wait for the prompt, and then type "ls", you might expect the "head -1"
to read and print "echo foo", the word "bar" to be printed, and an "ls"
to be executed.  Instead, the "head -1" will read "ls", and "foo" and
"bar" will be printed.  In other words, the line-editor has eaten
everything in the queue, even though it does not use the data.

You learn to live without typeahead or without a line editor.  I chose
to live without the editor.

-- 
David Elliott		dce at mips.com  or  {ames,prls,pyramid,decwrl}!mips!dce



More information about the Comp.unix.questions mailing list