Xref: utzoo comp.unix.wizards:21186 comp.unix.aix:787 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!servio!penneyj From: penneyj@servio.UUCP (D. Jason Penney) Newsgroups: comp.unix.wizards,comp.unix.aix Subject: Re: TTY without echos Message-ID: <402@servio.UUCP> Date: 26 Mar 90 17:15:25 GMT References: <1990Mar25.170947.2415@jdyx.UUCP> Reply-To: penneyj@servio.UUCP (D. Jason Penney) Distribution: usa Organization: Servio Logic Development Corp.; Beaverton, OR Lines: 38 [100 lashes with a wet noodle for anyone who doesn't post enough return address that one can follow up with e-mail!] In article <1990Mar25.170947.2415@jdyx.UUCP> shawn@jdyx.UUCP (Shawn Hayes) writes: > > I'm trying to set up a program to read and write characters to a tty >port. What I would like to have happen is I read a character from the port >and if it's a numeric character I echo it back, and if it is anything else >I ignore it. Currently I can type in alphabetic characters and they are ignored >, but as soon as I echo a numeric character back to the terminal the port >echoes every character. > > I've set up the port with a stty -echo -echoe -echok raw >but something must still be wrong in the setup. Is there a way to configure >a tty port to never echo characters, so that only the output from my program >shows up on the port? > > Shawn Hayes You don't say what brand of pUnyx you're running, but I suppose from the Newsgroups line that it's some form of AIX. 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). Note: the BSD incantation is somewhat different from this... 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. Workaround: use sprintf() to build the strings and then use write(2) to output the characters to the screen. This works like a champ for me in all pUnyx variants. -- D. Jason Penney Ph: (503) 629-8383 Beaverton, OR 97006 uucp: ...uunet!servio!penneyj (penneyj@slc.com) "Talking about music is like dancing about architecture." -- Steve Martin