stty -g output mapping to stty -a output

Alan P Barrett barrett at Daisy.EE.UND.AC.ZA
Wed Jun 12 00:51:10 AEST 1991


In article <14013 at dog.ee.lbl.gov>,
torek at elf.ee.lbl.gov (Chris Torek) writes:
> The output from `stty -g' is entirely private to the implementation,
> and may change from moment to moment.  The only constraint on it is that
> a later stty with that output should restore the terminal modes (i.e.,
> it has to contain enough information, in some arbitrary format, to do
> this).

Ah, but how much later?  Is the output of one stty -g allowed to be kept
somewhere and fed to another stty later, after the implementation has
changed?  How often is the implementation allowed to change?  I can do a
{mv my-new-and-improved-stty /bin/stty} any time, and thereby change the
implementation of stty instantaneously.  Now what happens to the
remembered output of the old stty -g?  Is it still expected to work?  If
so then surely there _should_ be a standard format (or at least a
standard lowest common denominator).

If the format is not expected to work from one implementation to
another, then how can an application rely on being able to do
{flags=`stty -g`; blah blah blah; stty $flags}?  It seems that we cannot
rely even on {stty `stty -g`} because the implementation of stty could
change during the execution of the command.

--apb
Alan Barrett, Dept. of Electronic Eng., Univ. of Natal, Durban, South Africa
RFC822: barrett at ee.und.ac.za             Bang: m2xenix!quagga!undeed!barrett



More information about the Comp.unix.questions mailing list