Type-ahead in unix

Chris Torek torek at elf.ee.lbl.gov
Thu Apr 18 02:34:35 AEST 1991


In article <28216:Apr1700:51:4791 at kramden.acf.nyu.edu>
brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>In fact, under your BSD 4.3++ (ahem), output is not re-echoed,

(output? you mean typeahead?  output certainly should not be reprinted.)
In most cases, typeahead should not be reprinted either (only if it was
`typed ahead' while echo was off).  Right now PENDIN is not always set
when it should be (mainly because it is `too hard' to tell when it should
be).

>^M is not converted back to ^J,

Hm.  This is more troublesome: conversion is a one-way street.  Once
input characters have been translated (e.g., ^V applied, ^C translated
to SIGINT, etc), there is no going back.  I am not entirely sure it is
right to do all this just because one non-ICANON-program exited before
another is about to start.

>and line editing does not work upon the typeahead.
>I just tried it today, so don't tell me things work.

I just tried that yesterday and it *did* work.  (It even let me back
up over newline, which is a bit odd.)  That is:

	stty -icanon; sleep 5; echo going back; stty icanon; sleep 5

and type several lines; after `going back' you can edit the typeahead.
But (as noted above) unconverted stuff is not converted; if you typed
^H while ICANON was clear, you have, in effect, typed ^V^H as far as
the ICANON-mode code is concerned.
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek at ee.lbl.gov



More information about the Comp.unix.questions mailing list