Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: typeahead problem
- X-seq: zsh-workers 4723
- From: Bernd Eggink <eggink@xxxxxxxxxxxxxx>
- To: zsh Workers <zsh-workers@xxxxxxxxxxxxxxx>
- Subject: Re: typeahead problem
- Date: Tue, 08 Dec 1998 19:38:53 +0100
- Organization: Regionales Rechenzentrum der Uni Hamburg
- References: <366D1DC2.2A726728@xxxxxxxxxxxxxxxxxx> <000701be22aa$df12ab80$21c9ca95@xxxxxxxxxxxxxxx> <366D32BB.79BDDC23@xxxxxxxxxxxxxxxxxx> <000a01be22b7$512aedc0$21c9ca95@xxxxxxxxxxxxxxx> <366D40E8.EAB05EE2@xxxxxxxxxxxxxxxxxx> <001101be22c3$12fde9b0$21c9ca95@xxxxxxxxxxxxxxx> <981208100629.ZM6018@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: rz2a022@xxxxxxxxxxxxxx
Bart Schaefer wrote:
> The question is which of those two cases `read -q` should emulate. The
> decision made was to treat it like spell checking, leaving the typeahead
> alone when possible so that other commands may consume it.
IMHO this decision was wrong, but it's probabely too late now. The
situation when I noticed that behaviour was in a loop consisting of
about 100 successive 'read -q' queries. ONE false move, and ALL
remaining questions get the answer 'no'. This can have very harmful
consequences, whereas not being able to type something in advance for
the next command is just a minor inconvenience.
> The way you
> get the "always consume one character" behavior is to use
>
> read -k1 "REPLY?Yes or no: " && do_something
Hm, no. You have to write something like
typeset -u REPLY
read -k1 "REPLY?Yes or no: "
[[ $REPLY == Y ]] && do_something
But apart from that you're right, of course.
Regards,
Bernd
--
Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg
eggink@xxxxxxxxxxxxxx
http://www.rrz.uni-hamburg.de/eggink/BEggink.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author