How to restore terminal after curses program crashes?

Dan_Jacobson at ATT.COM Dan_Jacobson at ATT.COM
Sat Feb 16 17:24:41 AEST 1991


>>>>> On 16 Feb 91 03:23:19 GMT, jpr at jpradley.jpr.com (Jean-Pierre Radley) said:

J-P> In article <DANJ1.91Feb13170109 at cbnewse.ATT.COM> Dan_Jacobson at ATT.COM writes:
>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
>"
>yup, I just say
>$ $stty^J
>and everthing is comfy again.

J-P> I do about the same thing, but with somewhat less effort.

J-P> In .profile,
J-P> 	STTY=`stty-g` export STTY

J-P> In .login,
J-P> 	setenv STTY `stty-g`

J-P> Then, after a scrambled screen,
J-P> 	$stty^J
J-P> restores my prior settings.

Yeah but, you omit any stty-ings you did before you captured them into
an environment variable---unless you're happy with the differing
defaults on different machines, e.g., "#"=erase.  Plus, stty -g, and
certainly stty-g, aren't portable.  Plus I invoke $stty in the
.profile too.

[Ego restored]
-- 
Dan_Jacobson at ATT.COM  Naperville IL USA  +1 708-979-6364



More information about the Comp.unix.programmer mailing list