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

typeahead problem

A sticking 'y' key on my keyboard revealed a weird zle behaviour which I
first assumed to be a bug, but after glancing through the sources turned
out to be a feature. In a script I have to process a long list of items,
and for each item there is a statement like

  read -q "REPLY?Yes or no: " && do_something

Now if "do_something" takes some time and you type at least one
character in advance, 'read -q' behaves as if you are constantly typing
'n', until you consume the pending character by a normal 'read'. In
other words, if you do NOT issue a normal read, EVERY following 'read
-q' will behave as if you had typed 'n', until the end of the script.

Is there a rationale for this feature  (which I still consider a bug,
because it makes 'read -q' nearly unusable, at least in scripts)?


Bernd Eggink
Regionales Rechenzentrum der Uni Hamburg

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