From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3586 invoked from network); 18 Sep 1998 14:56:49 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 18 Sep 1998 14:56:49 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id KAA15355; Fri, 18 Sep 1998 10:48:07 -0400 (EDT) Resent-Date: Fri, 18 Sep 1998 10:48:07 -0400 (EDT) Message-Id: <9809181440.AA18116@ibmth.df.unipi.it> To: zsh-workers@math.gatech.edu Subject: PATCH: select behaving strange in 3.1.4 In-Reply-To: "Goran Larsson"'s message of "Wed, 16 Sep 1998 00:14:47 DFT." Date: Fri, 18 Sep 1998 16:40:04 +0200 From: Peter Stephenson Resent-Message-ID: <"5gt0t3.0.sl3.dAd0s"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4389 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Goran Larsson wrote: > Look at this: > > $ echo $ZSH_VERSION > 3.1.4 > $ > $ cat select_weirdness > #!/usr/local/bin/zsh > > PROMPT3="What now?" > select junk in A B C; do > echo $junk > done > $ > $ ./select_weirdness > 1) A 2) B 3) C > What now?^D <-- enter control-D > $ > $ . ./select_weirdness > 1) A 2) B 3) C > What now?^D <-- enter control-D > zsh: do you wish to see all 1120 possibilities? y <-- enter y This should fix the ^D behaviour. isfirstln tells zleread() that it's at the start of input, so ^D is an end-of-file. It's really a lexical variable---it should probably be passed down to zle as an argument. Goodness knows if it needs saving and restoring. The ^C problem seems to be separate. *** Src/loop.c.eof Wed Apr 29 23:42:50 1998 --- Src/loop.c Fri Sep 18 15:09:26 1998 *************** *** 158,166 **** for (;;) { do { if (empty(bufstack)) { ! if (interact && SHTTY != -1 && isset(USEZLE)) str = (char *)zleread(prompt3, NULL, 0); ! else { str = promptexpand(prompt3, 0, NULL, NULL); zputs(str, stderr); free(str); --- 158,167 ---- for (;;) { do { if (empty(bufstack)) { ! if (interact && SHTTY != -1 && isset(USEZLE)) { ! isfirstln = 1; str = (char *)zleread(prompt3, NULL, 0); ! } else { str = promptexpand(prompt3, 0, NULL, NULL); zputs(str, stderr); free(str); -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Gruppo Teorico, Dipartimento di Fisica Piazza Torricelli 2, 56100 Pisa, Italy