Xref: utzoo comp.unix.programmer:1075 comp.unix.questions:28699 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!hsdndev!dartvax!eleazar.dartmouth.edu!mjm From: mjm@eleazar.dartmouth.edu (Andy Behrens) Newsgroups: comp.unix.programmer,comp.unix.questions Subject: Re: How to restore terminal after curses program crashes? Keywords: curses,cbreak,terminal Message-ID: <1991Feb14.192959.22939@dartvax.dartmouth.edu> Date: 14 Feb 91 19:29:59 GMT References: <1991Feb13.133332.22320@ousrvr.oulu.fi> Sender: news@dartvax.dartmouth.edu (The News Manager) Reply-To: andyb@coat.com (Andy Behrens) Organization: Burlington Coat Factory Lines: 21 clegg@tolsun.oulu.fi (Matthew Tran Clegg/VTT) writes: > I've been working on a program that uses the curses package and > cbreak mode. Once in a while, a bug will cause the program to > crash (for example, with a segmentation fault). > > Does anyone know how to restore the terminal to a sane state? > So far, the only thing that has worked for me is the power switch :-). The 'reset' command will do this. However, since curses has probably left your terminal in raw mode, carriage return is no longer considered to be an end-of-line character -- you'll have to use a newline instead. Typing ctrl-J reset ctrl-J should fix everything. If you've changed your kill characters, it will be reset to a default value, so you might want to set it again with 'stty'. Andy