Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!olivea!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: CBREAK on Interactive Unix 2.2 Message-ID: <5500@auspex.auspex.com> Date: 24 Jan 91 21:05:08 GMT References: <1991Jan21.035008.14489@ncs.dnd.ca> <381@bria> Organization: Auspex Systems, Santa Clara Lines: 24 > new.c_lflag &= ~ECHO; > new.c_lflag &= ~ICANON; > new.c_lflag &= ~ISIG; ... >Thus, using cbreak(1) would put the terminal into cbreak mode, And also turn off echoing and processing of signal characters such as the interrupt and quit characters, which turning CBREAK mode on, in systems with that mode, won't do. CBREAK, in systems that have it (well, in systems that have a V7-style CBREAK, and not some Mutant CBREAK From Hell), is the inverse of ICANON on systems that have it; turning CBREAK on is equivalent to turning ICANON off, setting c_cc[VMIN] to 1, and setting c_cc[VTIME] to 0, but leaving ECHO and ISIG alone. In practice, lots of programs that turn CBREAK mode on also want to turn echoing and the signal characters off, but not all do (most probably turn echoing off, but many may not turn the signal characters off), so the function in question may be what he wants - but it's not *necessarily* what he wants, as the program may really want the interrupt character to cause a SIGINT.