Xref: utzoo comp.unix.programmer:1142 comp.unix.questions:28888 Path: utzoo!censor!comspec!lethe!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!bria!mike Newsgroups: comp.unix.programmer,comp.unix.questions Subject: Re: How to restore terminal after curses program crashes? Message-ID: <436@bria> Date: 14 Feb 91 07:03:22 GMT References: <1991Feb13.133332.22320@ousrvr.oulu.fi> Reply-To: uunet!bria!mike Followup-To: comp.unix.programmer Organization: MGI Group International, Los Angeles, CA Lines: 29 In an article, 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). This completely >unhinges the terminal. It won't respond to anything anymore, >except if I press ^C, then the csh prompt will be printed. When your terminal is in a good mood, enter the following command: stty -g >$HOME/.stty Then, put an alias in your $HOME/.profile (or whatever), such as: sane() stty `cat $HOME/.stty` Obviously this is for the Bourne shell; translate as appropriate for csh, or whatever you prefer to use. So, when nethack bites the dust, you enter: $ sane^J This will restore your terminal exactly the way it was when you first entered the 'stty -g' command. -- Michael Stefanik | Opinions stated are not even my own. Systems Engineer, Briareus Corporation | UUCP: ...!uunet!bria!mike ------------------------------------------------------------------------------- technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly found to be saying things like "Well, it works on my DOS machine ..." Brought to you by Super Global Mega Corp .com