How to restore terminal after curses program crashes?

Roger Droz roger at gtisqr.uucp
Sat Feb 16 08:42:21 AEST 1991


In article <DANJ1.91Feb13170109 at cbnewse.ATT.COM> Dan_Jacobson at ATT.COM writes:
>> Once in a while, a bug will cause the program to crash (for example,
>> with a segmentation fault).  This completely unhinges the terminal.
>
>Most of the time I find the terminal will respond to "command^J", so I
>my .profile I have:
>
>if test -t
>then
>stty="eval
>	stty sane;
>	stty
>	echo
     [ rest deleted ]

How about simply:
	stty="stty `stty -g`"

>yup, I just say
>$ $stty^J
>and everthing is comfy again.

I agree with jik at athena.mit.edu (Jonathan I. Kamens) that one should
write the signal handlers early on so that your curses programs die
gracefully.
____________
               Roger Droz       
()       ()    Maverick MICRoSystems / Global Technology International
 (_______)     Mukilteo, WA 
  (     )      
   |   |       Disclaimer: "We're all mavericks here: 
   |   |                    Each of us has our own opinions,
   (___)                    and the company has yet different ones!"

Internet: roger at mav.COM     UUCP: uw-beaver!gtisqr!roger



More information about the Comp.unix.questions mailing list