From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id EAA27228 for ; Tue, 28 Nov 1995 04:30:52 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA17799; Mon, 27 Nov 1995 11:59:27 -0500 Resent-Date: Mon, 27 Nov 1995 17:56:36 +0100 Old-Return-Path: Message-Id: <9511271656.AA07662@hydra.ifh.de> To: becker@Atria.com Cc: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: zsh-beta12 read -q In-Reply-To: "becker@phobos.atria.com"'s message of "Mon, 27 Nov 1995 11:07:40 MET." <9511271607.AA01231@phobos> Date: Mon, 27 Nov 1995 17:56:36 +0100 From: Peter Stephenson Resent-Message-Id: <"ysVT6.0.-L4.kvUkm"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/652 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu becker@phobos.atria.com wrote: > from within a shell script, this script hangs in my xterm. > > % cat sample_script > read -q 'answ?Continue? [n] :' > echo "test done; returned $? " I posted this patch to fix it (read -k too)... since the symptoms it fixes are different on my machine (it messes up the terminal but doesn't hang) I'd appreciate a confirmation that it fixes it in this case too. The best theory is it's related to the fact that various terminal stuff is now delayed in interactive shells to avoid causing problems when the shell is put into the background. *** Src/builtin.c.ti Tue Nov 7 09:48:32 1995 --- Src/builtin.c Wed Nov 8 16:36:58 1995 *************** *** 4615,4620 **** --- 4615,4622 ---- fflush(stderr); return 1; } + if (!isset(INTERACTIVE)) + gettyinfo(&shttyinfo); /* sort out the number of characters to read */ if (*args && idigit(**args)) { if (!(nchars = atoi(*args))) *************** *** 4804,4809 **** --- 4806,4813 ---- fflush(stderr); return 1; } + if (!isset(INTERACTIVE)) + gettyinfo(&shttyinfo); /* set up the buffer */ readbuf = (char *)zalloc(2); -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77330 Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.