Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.unix.programmer Subject: Re: How to restore terminal after curses program crashes? Message-ID: Date: 17 Feb 91 22:00:24 GMT References: <1991Feb15.214221.11464@gtisqr.uucp> <449@bria> <28768:Feb1714:55:3591@kramden.acf.nyu.edu> <1991Feb17.164719.17328@IRO.UMontreal.CA> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 131 In-reply-to: babin@IRO.UMontreal.CA's message of 17 Feb 91 16:47:19 GMT In article <1991Feb17.164719.17328@IRO.UMontreal.CA> babin@IRO.UMontreal.CA (Gilbert Babin) writes: | I have the same problem with AIX, but whenever I type a character (any one) | after the crash, the shell goes into an infinite loop. | | Any ideas on how to solve that on AIX? When debugging applications like the above, I typically invoke it via: nethack; reset_tty where reset_tty is my shell script to reset all terminal modes to normal values. For most people, you can do: stty sane stty dec (stty dec resets some things that sane does). In case you are curious, here is my reset_tty shell script (I have 3 environment variables set in my .profile depending on what system I'm on -- ATT_STTY, OSF1_STTY, and BSD_STTY): #! /bin/sh if [ "$ATT_STTY" != "" ]; then stty \ erase "^?" \ kill "^u" \ intr "^c" \ quit "^\\" \ eof "^d" \ eol "^-" \ swtch "^z" \ isig \ icanon \ istrip \ echoe \ echok \ ignbrk \ opost \ ixon \ ixoff \ -ixany \ -echonl \ -onlret \ -xcase if [ "${EMACS}" = "t" -o "${EMACS_KLUDGE}" = "t" ]; then stty -echo onlret fi elif [ "$OSF1_STTY" != "" ]; then stty \ erase "^?" \ kill "^u" \ intr "^c" \ quit "^\\" \ eof "^d" \ eol "^-" \ rprnt "^r" \ flush "^o" \ werase "^w" \ lnext "^v" \ susp "^z" \ dsusp "^^" \ isig \ icanon \ istrip \ echoe \ echok \ ignbrk \ opost \ ixon \ ixoff \ -ixany \ -echonl \ -onlcr if [ "${EMACS}" = "t" -o "${EMACS_KLUDGE}" = "t" ]; then stty -echo onlcr fi else stty new stty erase "^?" \ kill "^u" \ intr "^c" \ quit "^\\" \ start "^q" \ stop "^s" \ eof "^d" \ rprnt "^r" \ flush "^o" \ werase "^w" \ lnext "^v" \ susp "^z" \ dsusp "^^" \ cooked \ cr0 \ crtbs \ crterase \ crtkill \ ctlecho \ decctlq \ echo \ even \ ff0 \ -lcase \ -litout \ -nl \ nl0 \ -noflsh \ -nohang \ odd \ pass8 \ -prterase \ -tabs \ tandem \ -tilde \ -tostop if [ "${EMACS}" = "t" -o "${EMACS_KLUDGE}" = "t" ]; then stty -echo nl fi fi -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?