Xref: utzoo comp.unix.microport:468 comp.unix.xenix:1927 comp.unix.questions:6517 Path: utzoo!mnetor!uunet!vsi!friedl From: friedl@vsi.UUCP (Stephen J. Friedl) Newsgroups: comp.unix.microport,comp.unix.xenix,comp.unix.questions Subject: Re: Microport console driver & raw mode programs Message-ID: <519@vsi.UUCP> Date: 10 Apr 88 17:35:30 GMT References: <362@mancol.UUCP> <128@obie.UUCP> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 38 Keywords: console driver, raw mode, vi, problems Summary: alternate tty reset command In article <128@obie.UUCP>, wes@obie.UUCP (Barnacle Wes) writes: > It could be that elm is not restoring your stty settings correctly. I > have a simple csh alias that takes care of this problem, which is > especially frequent in my own programs: :-) > > alias oops 'stty sane erase \^h intr \^c kill \^y echoe ixany ; stty' > > This restores my stty settings (at least the ones that seem to get > garbled the most) and then prints them on the screen. Alternate generic way to reset your favorite tty settings: "stty -g" outputs a string of the current stats that you can't read but stty can. $ stty -g d26:5:dad:3b:7f:1c:8:15:4:0:0:0 It turns out that it maps directly to |struct termio| fields, but you don't need to pay attention to the specifics. Now, set this string in your .profile after setting your favorite stty modes: STTYMODES=`stty -g` ; export STTYMODES # save tty modes Now `oops' (I call it `reset') can be a shell script that does: if [ "$STTYMODES" ] ; then stty $STTYMODES else stty sane erase '^h' intr '^c' kill '^y' echoe ixany fi stty If you have saved your tty modes, they are restored, otherwise you get some hopefully reasonable defaults. -- Steve Friedl V-Systems, Inc. "Yes, I'm jeff@unh's brother" friedl@vsi.com {backbones}!vsi.com!friedl attmail!vsi!friedl