Is typeahead loss a generic ksh problem?

Leo de Wit leo at philmds.UUCP
Wed May 25 20:35:47 AEST 1988


In article <7930 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
>In article <2208 at quacky.mips.COM> dce at mips.COM (David Elliott) writes:
>>You learn to live without typeahead or without a line editor.  I chose
>>to live without the editor.
>
>There is no need for typeahead to be flushed when the terminal handler
>mode is changed via ioctl.  That is an artifact of the old, creaky
>terminal handler most 4BSD-based systems are still saddled with.  In
>fact it isn't even necessary on modern 4BSD systems; I often type
>ahead just after invoking our local screen editor, which definitely
>changes terminal modes after my first few characters but does not
>lost them.


Although the discussion was kind of closed, I would like to make a remark
about typeahead, flushing etc. because I have seen nobody mentioning this:

>From the stty manual page (to give it an 'official' ring *-) :

pendin   Input is pending after a switch from cbreak to cooked and will be
         re-input when a read becomes pending or more input arrives (internal
         state bit).

I also have no problems with typeahead flushing (I use the esh which is a
Bourne sh with csh features like command line editing with cursor keys etc,
foreground/background and other features of the csh). I also use stty new
(I think this also sets pending) and although the shell must run in cbreak
mode no characters are lost (thanks to 'pendin'). I suggest the originator
of the problem uses: stty new; maybe this solves his problem.

        Leo.



More information about the Comp.unix.questions mailing list