Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: read -sq
- X-seq: zsh-users 26549
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: read -sq
- Date: Sun, 21 Feb 2021 09:31:15 -0800
- Archived-at: <https://zsh.org/users/26549>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-02/CAH%2Bw%3D7Y61xDwoONbL8c0EBMecck9oXavoOzBuDHDUu89d5bN1A%40mail.gmail.com>
- In-reply-to: <6a5328e7-e58d-5b47-c0df-463bf4c144ea@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <6a5328e7-e58d-5b47-c0df-463bf4c144ea@eastlink.ca>
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