zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: read -sq
Date: Sun, 21 Feb 2021 09:31:15 -0800	[thread overview]
Message-ID: <CAH+w=7Y61xDwoONbL8c0EBMecck9oXavoOzBuDHDUu89d5bN1A@mail.gmail.com> (raw)
In-Reply-To: <6a5328e7-e58d-5b47-c0df-463bf4c144ea@eastlink.ca>

On Sun, Feb 21, 2021 at 8:42 AM Ray Andrews <rayandrews@eastlink.ca> 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.


  reply	other threads:[~2021-02-21 17:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21 16:41 Ray Andrews
2021-02-21 17:31 ` Bart Schaefer [this message]
2021-02-21 17:54   ` Ray Andrews
2021-02-21 21:00     ` Bart Schaefer
2021-02-21 21:58       ` Ray Andrews
2021-02-21 23:03         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Y61xDwoONbL8c0EBMecck9oXavoOzBuDHDUu89d5bN1A@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).