Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!oliveb!sun!gorodish!guy From: guy@gorodish.UUCP Newsgroups: comp.lang.c,comp.unix.questions Subject: Re: Question on implementing "repeat...until keypress"? Message-ID: <12911@sun.uucp> Date: Sun, 8-Feb-87 19:21:26 EST Article-I.D.: sun.12911 Posted: Sun Feb 8 19:21:26 1987 Date-Received: Mon, 9-Feb-87 04:52:54 EST References: <32100@auc.UUCP> <1485@megaron.arizona.edu> Sender: news@sun.uucp Reply-To: guy@sun.UUCP (Guy Harris) Followup-To: comp.unix.questions Organization: Sun Microsystems, Mountain View Lines: 36 Keywords: terminfo termcap stty Xref: watmath comp.lang.c:970 comp.unix.questions:976 (This is NOT a C question, it's an operating system question. C doesn't know anything about modes for reading lines vs. modes for reading characters, which is as it should be. I'm redirecting this to comp.unix.questions, where it belongs.) > ioctl(0, TIOCGETP, &ttyb); > ttyb.sg_flags ^= (RAW | ECHO); > ioctl(0, TIOCSETP, &ttyb); Is there some reason why this example requires that you: 1) turn off parity checking and generation? 2) disable XON/XOFF flow control? 3) disable the user's interrupt and quit characters? 4) disable all special output processing (such as mapping newlines to CR/LF)? If not, then you should be going into CBREAK mode, not RAW mode. (Two advantages of the S3/S5 terminal driver interface: 1) it doesn't have CBREAK or RAW mode, so you have to think about what you want to change, and 2) it's different from the older ones, so you can't just work from mistaken impressions about what RAW mode really is.) RAW mode was intended for binary data transfer, as is used for up/down loading terminals and the like, UUCP, etc.. (Yes, I know EMACS uses it, but that's just because the only way to guarantee no special input processing whatsoever with the older V7-style interface is to turn RAW mode on.) The original poster said they were running under S5, so V7/BSD solutions don't help much. John Plocher's solution is a correct one for those systems.