Xref: utzoo comp.unix.programmer:1065 comp.unix.questions:28653 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!herald.usask.ca!alberta!pawel From: pawel@cs.UAlberta.CA (Pawel Gburzynski) Newsgroups: comp.unix.programmer,comp.unix.questions Subject: Re: How to restore terminal after curses program crashes? Message-ID: <1991Feb13.191442.16443@cs.UAlberta.CA> Date: 13 Feb 91 19:14:42 GMT References: <1991Feb13.133332.22320@ousrvr.oulu.fi> Sender: news@cs.UAlberta.CA Organization: University of Alberta, Edmonton, Canada Lines: 21 From article <1991Feb13.133332.22320@ousrvr.oulu.fi>, by clegg@tolsun.oulu.fi (Matthew Tran Clegg/VTT): > 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. > > (I've noticed sometimes that nethack will crash in this way too, but > only when the game is better than any I've had in months -- a real bummer.) > > 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 :-). > > Matthew Clegg > clegg@tolsun.oulu.fi, February 13 How about 'tset ^j' (^j stands for control j). Generally, it is a bad habit for a program using curses to crash without regaining control for resetting the terminal. Pawel Gburzynski