BSD vs. SVR4 typehead flush after tty mode change

Rahul Dhesi dhesi%cirrusl at oliveb.ATC.olivetti.com
Wed Oct 17 08:55:30 AEST 1990


UNIX assumes a per-tty state rather than a per-process state, i.e.,
it's the tty driver that's in a certain mode of operation rather than
the process.  This leads to all sorts of problems.  (Though it no doubt
greatly simplifies the system call interface and avoids the QIO fiasco
in VMS.)

I think the tty stream ("stream", not necessarily "STREAM") should
associate each data byte with a control byte.  The control byte could
tell you when EOF was seen, and also what state the tty was in when the
character was read.  My gut feeling is that this would make all sorts
of tty interfaces (including what BSD does and what SVR4 does) more
powerful.  You could even go so far as putting a "delete previous
character" control byte in the stream, so the next module in the STREAM
("STREAM", not necessarily "stream") could edit the incoming stream of
characters.
--
Rahul Dhesi <dhesi%cirrusl at oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi



More information about the Comp.unix.questions mailing list