home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!darwin.sura.net!jvnc.net!yale.edu!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: comp.sys.sun.hardware
- Subject: Re: Using STTY to change TTY characteristics
- Date: 27 Jul 1992 19:45:37 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 25
- Distribution: na
- Message-ID: <151jp1INN7ri@early-bird.think.com>
- References: <1392@sousa.ltn.dec.com>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <1392@sousa.ltn.dec.com> tarsa@elijah.mv.com (Greg Tarsa) writes:
- >In trying to do this I have encountered a strange problem: I cannot seem to set
- >the terminal line characteristics with stty. As far as I can tell, the stty
- >call is either having no effect, or something is changing the characteristics
- >back as soon as my stty request is complete.
-
- Tty settings revert to their default when no process has the device open.
- Therefore, to get the settings to last, you have to keep the device open.
- You can either do this by running the program from the same subprocess that
- modifies the settings, e.g.
-
- (stty ...; command) >/dev/ttya
-
- will run "command" with the new tty settings in effect, or by running a
- dummy process that keeps the tty open, e.g.
-
- sleep 86400 > /dev/ttya &
- stty ... >/dev/ttya
-
- The sleep process will cause the settings to remain for a day.
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-