I'm running % read -q
, and then typing a single character which isn't y
, Y
or n
. However, the value set in $REPLY
isn't n
, it is the character I typed.
The documentation for read -q
explicitly says:
Read only one character from the terminal and set name to ‘y’ if this character was ‘y’ or ‘Y’ and to ‘n’ otherwise.
This behavior reproduces on OSX 10.7 using zsh 4.3.11 (default) and 5.0.0 (Homebrew), but not on Linux (Ubuntu 12.04, zsh 4.3.10) - on Linux, the value in $READ
is n
, as expected.
Also, I've tried running under zsh -f
, same results (i.e., I don't think it's in my init scripts).
Am I missing something?
This is indeed a bug, and has been for two and a half years. It was inadvertently lost by the patch in zsh-workers article 27188. Patch in article 30949.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With