From: Sebastien Peterson-Boudreau <sebastien.peterson.boudreau@gmail.com>
To: "dash@vger.kernel.org" <dash@vger.kernel.org>
Subject: Re: stty -echo doesn't work?
Date: Fri, 24 Apr 2026 00:25:42 -0300 [thread overview]
Message-ID: <aeritsy5VkLSE6H_@HQ> (raw)
In-Reply-To: <aa17c927-f25e-4556-88df-df9cb0aba199@case.edu>
> The `cat' behavior is consistent with how POSIX describes `stty echo':
>
> echo (-echo)
> Echo back (do not echo back) every character typed. This shall have the
> effect of setting (not setting) ECHO in the termios c_lflag field, as
> defined in XBD 11. General Terminal Interface.
>
> So the `echo' suboption only controls echoing of input. If dash, when
> using libedit and with editing enabled (e.g., `set -o emacs'), restores
> echo when reading the command line, it would appear that libedit is
> forcing a known set of tty flags.
Thank you; this is the sort of stuff I meant when I said I felt like I
needed to do more research, but you've done it for me.
> > now that is what I _expected_ to happen, but that is based on bash's
> > behaviour, which is based on readline (what bash uses (I think?)).
>
> It does.
>
Thank you for confirming :)
> Do you think that the editing library should honor the user's tty settings
> modified using `stty', use its own internal `sane' settings to provide
> consistent behavior, or use internal settings separate from the ones set
> using `stty' but provide a shell builtin that allows users to modify those
> internal settings (e.g., tcsh's `setty')?
>
> All of these are reasonable choices that different shells have made.
> Readline, obviously, uses the first option.
>
The only one of these that I really object to is the second (which is
what libedit does), because it is the one (in my opinion) that is most
suprising for the user. The first is maybe the simplest/cleanest (least
suprise), again, in my opinion.
As you said, though, these are all reasonable choices, so this is
decidedly not a bug in dash (or, rather, libedit), but just behaviour I
was not expecting.
> > Well now I feel like I might need to do
> > some more research. Maybe this is a situation where bash does something
> > weird but we're all used to it.
>
> I would argue otherwise, of course.
I really should have emphasized the _maybe_ in that comment. I really
just didn't want to seem completely ignorant for expecting dash to
behave the same as bash in the case that it (bash) was actually doing
the wrong (but maybe more appealing) thing.
--
S.
prev parent reply other threads:[~2026-04-24 3:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 2:39 stty -echo doesn't work? Sebastien Peterson-Boudreau
2026-04-23 7:05 ` Harald van Dijk
2026-04-23 21:36 ` Sebastien Peterson-Boudreau
2026-04-24 0:17 ` Chet Ramey
2026-04-24 3:25 ` Sebastien Peterson-Boudreau [this message]
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=aeritsy5VkLSE6H_@HQ \
--to=sebastien.peterson.boudreau@gmail.com \
--cc=dash@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox