Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: select behaving strange in 3.1.4



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 <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Gruppo Teorico, Dipartimento di Fisica
Piazza Torricelli 2, 56100 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author