Subject: Re: defaults for tty open
To: Eduardo E. Horvath eeh@btr.com <eeh@btr.btr.com>
From: Bill Studenmund <wrstuden@loki.Stanford.EDU>
List: tech-kern
Date: 02/02/1996 09:33:55
> On Thu, 1 Feb 1996, Bill Studenmund wrote:
> 
> > Also, I agree that it's dangerous for a program to assume a tty will be
> > just as it needs it, but what do we do for programs which can't set
> > tty settings right? lpd comes to mind. It does NOT support 57600
> > baud, and its method of setting control flags looks archaic.
> 
> sleep 10000000 </dev/ttyxx >/dev/ttyxx& 
> stty </dev/ttyxx -echo raw 57600
> lpd
> 
> Or you could do something equivalent with a print filter shell script.

I agree that this trick would fix lpd, but the problem is that echo
should never be on. If some other, unprotected command gets to the
serial port (like a user cat'ing a file out to the printer), then
echo comes back to life, and ugly white-on-black characters blossom
like snails after the rains (Hmm. can you guess what season we're in?).

So are there any other options to get echo to not be the default, other
than the solution of caching a copy of the defaults in a private
tty structure, and imposing these defaults on `first open'? Oh, I
do like Charles's suggestion that a whole termios struct should be
saved, not just part.

Thanks!

Take care,

Bill