Xref: utzoo comp.unix.programmer:1089 comp.unix.questions:28769 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!pacbell.com!att!cbnewse!danj1 From: Dan_Jacobson@ATT.COM Newsgroups: comp.unix.programmer,comp.unix.questions Subject: Re: How to restore terminal after curses program crashes? Message-ID: Date: 16 Feb 91 06:24:41 GMT References: <1991Feb13.133332.22320@ousrvr.oulu.fi> <1991Feb13.191442.16443@cs.UAlberta.CA> <1991Feb16.032319.2676@jpradley.jpr.com> Sender: danj1@cbnewse.att.com (Dan Jacobson) Reply-To: Dan_Jacobson@ATT.COM Organization: AT&T-BL, Naperville IL, USA Lines: 52 In-Reply-To: jpr@jpradley.jpr.com's message of 16 Feb 91 03:23:19 GMT >>>>> On 16 Feb 91 03:23:19 GMT, jpr@jpradley.jpr.com (Jean-Pierre Radley) said: J-P> In article Dan_Jacobson@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@ATT.COM Naperville IL USA +1 708-979-6364