Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!sunybcs!neil From: neil@sunybcs.UUCP Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Re: cbreak mode Message-ID: <2081@sunybcs.UUCP> Date: Mon, 26-Jan-87 00:53:04 EST Article-I.D.: sunybcs.2081 Posted: Mon Jan 26 00:53:04 1987 Date-Received: Mon, 26-Jan-87 06:42:24 EST References: <1484@cit-vax.Caltech.Edu> <194@nbc1.UUCP> Sender: nobody@sunybcs.UUCP Reply-To: neil@joey.UUCP (Neil Smithline) Organization: SUNY/Buffalo Computer Science Lines: 35 Xref: watmath comp.unix.wizards:710 comp.unix.questions:801 In article <194@nbc1.UUCP> abs@nbc1.UUCP (Andrew Siegel) writes: >> ... I found that the program >> >> #include >> #include >> >> main() >> { >> cbreak(); >> nocbreak(); >> } >> >> would leave the machine in cbreak mode. >If you're using curses, you must begin your program with a call to >initscr(), and terminate it with endwin(). The endwin() call returns >the tty parameters to their original setting. The function initscr() needs to be called before screen and window functions only. cbreak() and nocbreak() are not screen or window functions so it shouldn't have to be called. Calling endwin() does call resetty() which does restore the terminal settings but nocbreak() should take the terminal out of cbreak mode. As far as why this doesn't work... I dunno; I have found problems like this before with curses and terminal modes and have managed to avoid them but never fix them. Neil Neil Smithline CSnet: neil@buffalo ARPA: neil.buffalo@rand-relay Bitnet: NEIL@SUNYBCS uucp: {decvax!watmath} {pur-ee!rocks34!rocksvax} {{allegra, seismo}!rochester!rocksvax} !sunybcs!neil