How to restore terminal after curses program crashes?

Dan_Jacobson at ATT.COM Dan_Jacobson at ATT.COM
Thu Feb 14 10:01:18 AEST 1991


> 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
	echok
	echoe
	ixany
	hupcl
	icanon
	icrnl
	-ocrnl
	onlcr
	-onocr
	erase ${erase_character-^?}
	intr ^G
	kill ^-
	eof ^D
	$stty_extra
"
#$erase_character: can set to ^H for those terminals where more convenient
#swtch '^Z' #^Z: datakit, swtch: not in Sun's 5bin/stty
#hupcl: then Oliver Lauman's screen(1) won't hang. sure, buddy.
export stty; $stty #now have handy $stty variable... if my terminal
#gets screwed up I just say $stty at the prompt


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

you're welcome.
-- 
Dan_Jacobson at ATT.COM  Naperville IL USA  +1 708-979-6364



More information about the Comp.unix.questions mailing list