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

Re: read -sq



On Sun, Feb 21, 2021 at 8:42 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> If I use 'read -sq' and don't press 'y' (to do whatever), if the non 'y'
> key is some normal alphabetic key, it is not echoed to the terminal as
> '-s' indicates is correct, but if I use another key -- an arrow or DEL
> or END or one of those, it is echoed.  Can that be prevented?

Not really.  As the doc for -q says, "Read only one character from the
terminal", but the arrow keys actually send more than one character.
In the case of down-arrow those are ESC, bracket, and B, so read
consumes and discards the ESC and then whatever comes after it gets
the bracket and the B.




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