Is typeahead loss a generic ksh problem?

Doug Gwyn gwyn at brl-smoke.ARPA
Thu May 19 01:07:09 AEST 1988


In article <8062 at elsie.UUCP> ado at elsie.UUCP (Arthur David Olson) writes:
>At times ksh will flush typeahead, as shown by the transcript below:
>Is this a problem with other versions of ksh?  Is there a known fix?

It's really a problem with the BSD V7-based terminal handler, which makes
it difficult to switch modes without losing typeahead.  However, it can
be done, as witness the BRL Bourne shell which doesn't have this problem
(at least, not when linked with our System V emulation library).  We DO
have the problem to some degree with our Cray-2, which relies on TELNET
protocols to have the "front end" system take care of most aspects of
terminal handling instead of doing it right.  On the Cray-2 I added a
small delay before switching modes to give output time to drain before
the OLFCR mapping goes away, but that's not entirely satisfactory either.

I suspect the ksh sources could be tweaked for better operation on BSD
by borrowing some of the tricks used in my System V ioctl() emulation.
Future releases of BSD are supposed to have a POSIX-compatible terminal
handler.



More information about the Comp.unix.questions mailing list