zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@math.gatech.edu
Subject: PATCH: select behaving strange in 3.1.4
Date: Fri, 18 Sep 1998 16:40:04 +0200	[thread overview]
Message-ID: <9809181440.AA18116@ibmth.df.unipi.it> (raw)
In-Reply-To: "Goran Larsson"'s message of "Wed, 16 Sep 1998 00:14:47 DFT." <m0zJ3N1-000X3MC@mailgw.approve.se>

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


  parent reply	other threads:[~1998-09-18 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-15 22:14 Goran Larsson
1998-09-16  0:37 ` Bart Schaefer
1998-09-16  5:24   ` Goran Larsson
1998-09-18 14:40 ` Peter Stephenson [this message]
1998-09-18 15:14 ` PATCH: select behaving strange in 3.1.4 (2) Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9809181440.AA18116@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).