Xref: utzoo comp.unix.wizards:21199 comp.unix.aix:797 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.wizards,comp.unix.aix Subject: Re: TTY without echos Message-ID: <3085@auspex.auspex.com> Date: 27 Mar 90 18:44:16 GMT References: <1990Mar25.170947.2415@jdyx.UUCP> <402@servio.UUCP> Followup-To: comp.unix.wizards Distribution: usa Organization: Auspex Systems, Santa Clara Lines: 31 >I strongly recommend setting the terminal into RAW mode directly >from within your program (i.e., > >c_lflag &= ~(HUPCL | ICANON | ISIG | ECHO), >c_cc[VMIN] = 1, c_cc[VTIME] = 0). Well: 1) HUPCL has nothing to do with "raw mode"; 2) you may or may not want to turn ISIG off. Turning it off means your interrupt character (^C, , whatever) has no effect; leaving it on means that it still generates the appropriate signal. If you *do* want to be able to interrupt things with ^C or or whatever, leave it on, but remember to *catch* the SIGINT signal and restore the tty modes back to their original values before exiting. >Note: the BSD incantation is somewhat different from this... BSD RAW mode turns off the signal characters; BSD CBREAK mode doesn't, just as turning ICANON off doesn't. >I suspect from your description that you're using stdio to do the >echoing. It could possibly be the case that stdio clears these flags. The only terminal "ioctl" function every standard I/O implementation I know of does is the one to read the current settings, and it only does that to see if a file descriptor refers to a terminal. None of them change the settings; it's conceivable that some broken implementation out there does, but it's unlikely.