简体   繁体   中英

zsh read -q broken on OSX?

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 (ie, 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM