home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sun / hardware / 3560 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  1.4 KB

  1. Path: sparky!uunet!darwin.sura.net!jvnc.net!yale.edu!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.sys.sun.hardware
  4. Subject: Re: Using STTY to change TTY characteristics
  5. Date: 27 Jul 1992 19:45:37 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 25
  8. Distribution: na
  9. Message-ID: <151jp1INN7ri@early-bird.think.com>
  10. References: <1392@sousa.ltn.dec.com>
  11. NNTP-Posting-Host: telecaster.think.com
  12.  
  13. In article <1392@sousa.ltn.dec.com> tarsa@elijah.mv.com (Greg Tarsa) writes:
  14. >In trying to do this I have encountered a strange problem: I cannot seem to set
  15. >the terminal line characteristics with stty.  As far as I can tell, the stty
  16. >call is either having no effect, or something is changing the characteristics
  17. >back as soon as my stty request is complete.
  18.  
  19. Tty settings revert to their default when no process has the device open.
  20. Therefore, to get the settings to last, you have to keep the device open.
  21. You can either do this by running the program from the same subprocess that
  22. modifies the settings, e.g.
  23.  
  24.     (stty ...; command) >/dev/ttya
  25.  
  26. will run "command" with the new tty settings in effect, or by running a
  27. dummy process that keeps the tty open, e.g.
  28.  
  29.     sleep 86400 > /dev/ttya &
  30.     stty ... >/dev/ttya
  31.  
  32. The sleep process will cause the settings to remain for a day.
  33. -- 
  34. Barry Margolin
  35. System Manager, Thinking Machines Corp.
  36.  
  37. barmar@think.com          {uunet,harvard}!think!barmar
  38.