Xref: utzoo comp.unix.programmer:1086 comp.unix.questions:28748 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!uupsi!jpradley!jpr From: jpr@jpradley.jpr.com (Jean-Pierre Radley) Newsgroups: comp.unix.programmer,comp.unix.questions Subject: Re: How to restore terminal after curses program crashes? Message-ID: <1991Feb16.032319.2676@jpradley.jpr.com> Date: 16 Feb 91 03:23:19 GMT References: <1991Feb13.133332.22320@ousrvr.oulu.fi> <1991Feb13.191442.16443@cs.UAlberta.CA> Organization: NYC Public Unix Lines: 46 In article Dan_Jacobson@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 > 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. I do about the same thing, but with somewhat less effort. In .profile, STTY=`stty-g` export STTY In .login, setenv STTY `stty-g` Then, after a scrambled screen, $stty^J restores my prior settings. Jean-Pierre Radley NYC Public Unix jpr@jpradley.jpr.com CIS: 72160,1341