How to restore terminal after curses program crashes?

Pawel Gburzynski pawel at cs.UAlberta.CA
Thu Feb 14 06:14:42 AEST 1991


>From article <1991Feb13.133332.22320 at ousrvr.oulu.fi>, by clegg at 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 at 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



More information about the Comp.unix.programmer mailing list