zsh-workers
 help / color / mirror / code / Atom feed
From: Bernd Eggink <eggink@uni-hamburg.de>
To: zsh Workers <zsh-workers@math.gatech.edu>
Subject: Re: typeahead problem
Date: Tue, 08 Dec 1998 16:08:24 +0100	[thread overview]
Message-ID: <366D40E8.EAB05EE2@rrz.uni-hamburg.de> (raw)
In-Reply-To: <000a01be22b7$512aedc0$21c9ca95@mowp.siemens.ru>

Andrej Borsenkow wrote:
> 
> >
> > In Linux and AIX 4.2 there is no difference in the behaviour whether or
> > not I define CLOBBERS_TYPEAHEAD in config.h. Hm, is that the right
> > location? I also added "x-*-linux*" to the switch in the "TYPEAHEAD
> > KLUDGE" section in configure.in, but that didn't change anything either.
> >
> 
> Sorry, it is unrelated to typeahead probleam, I had to read better :(
> 
> I tried it here with 3.1.5 + patches. It looks, like ZSH takes the first
> character on the line and ignores the rest.
> 
> while read -q && sleep 10
> do
> echo YES
> done
> y <- cursor immediately springs to the next line
> yyyYES
>       ^^^ output by ZSH
> <- note newline
> YES
> 
> Only first 'y' from 'yyy' is taken. Is it what you've seen?

No. For example, try this script:

  for i in {1..}
  do if read -q "REPLY?y/n: "
     then print yes
     else print no
     fi
     sleep 1
  done

After the first prompt, type aa quickly (or any other characters). On
Linux and AIX, I get

  y/n: a
  no
  ay/n: n
  no
  ay/n: n
  no
  ay/n: n
  no
  ay/n: n
  no
  $ a

where $ stands for the shell prompt.

I guess the problem is getzlequery() in Zle/zle_utils.c. The comment
says: "If there are any characters in the buffer, this is taken as a
negative response, and no characters are read." This sounds like an
exact description of what happens, and doesn't seem to make much sense.
Why aren't the characters in the buffer read?? OTOH, there is no such
bug on HP-UP, so I hesitate to hack the sources blindly...

Bernd

--
Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg
eggink@rrz.uni-hamburg.de
http://www.rrz.uni-hamburg.de/eggink/BEggink.html


  reply	other threads:[~1998-12-08 15:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-08 12:38 Bernd Eggink
1998-12-08 13:01 ` Andrej Borsenkow
1998-12-08 14:07   ` Bernd Eggink
1998-12-08 14:30     ` Andrej Borsenkow
1998-12-08 15:08       ` Bernd Eggink [this message]
1998-12-08 15:54         ` Andrej Borsenkow
1998-12-08 17:39           ` Bernd Eggink
1998-12-08 18:06           ` Bart Schaefer
1998-12-08 18:38             ` Andrej Borsenkow
1998-12-08 18:38             ` Bernd Eggink
1998-12-08 21:22               ` Bart Schaefer

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=366D40E8.EAB05EE2@rrz.uni-hamburg.de \
    --to=eggink@uni-hamburg.de \
    --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).