From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13228 invoked from network); 8 Dec 1998 18:41:10 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 8 Dec 1998 18:41:10 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id NAA21452; Tue, 8 Dec 1998 13:40:11 -0500 (EST) Resent-Date: Tue, 8 Dec 1998 13:40:11 -0500 (EST) Sender: rz2a022@uni-hamburg.de Message-ID: <366D723D.A710FD4E@uni-hamburg.de> Date: Tue, 08 Dec 1998 19:38:53 +0100 From: Bernd Eggink Organization: Regionales Rechenzentrum der Uni Hamburg X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.0.35 i586) X-Accept-Language: de MIME-Version: 1.0 To: zsh Workers Subject: Re: typeahead problem References: <366D1DC2.2A726728@rrz.uni-hamburg.de> <000701be22aa$df12ab80$21c9ca95@mowp.siemens.ru> <366D32BB.79BDDC23@rrz.uni-hamburg.de> <000a01be22b7$512aedc0$21c9ca95@mowp.siemens.ru> <366D40E8.EAB05EE2@rrz.uni-hamburg.de> <001101be22c3$12fde9b0$21c9ca95@mowp.siemens.ru> <981208100629.ZM6018@candle.brasslantern.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-Message-ID: <"c69dI3.0.6F5.AANRs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4723 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu 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@uni-hamburg.de http://www.rrz.uni-hamburg.de/eggink/BEggink.html