Re: Commentary on: Bash Command Leads to ...

Andrew Church <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
Greg Wooledge wrote:
>Imagine you run a command like "stty" which alters the terminal state
>(intentionally).  You wouldn't want bash to undo this.  So, if stty
>exits in a normal manner, the terminal changes are retained.
[...]
>A "crash" is indistinguishable from a normal exit, from the shell's point
>of view, unless the "crash" is the result of a signal.

As someone who's been bitten by this occasionally, though never badly
enough to look into the issue in detail, I'm wondering -- would it be
reasonable for bash to limit its interpretation of a "normal" exit to
"WIFEXITED(status) && WEXITSTATUS(status) == 0"?  Conversely, is there
any case in which one would want to retain changes made to the terminal
state when stty or a similar program exits with a non-zero status?
(My "man stty" says nothing about the exit status, so it's entirely
possible I'm missing some subtleties.)

  --Andrew Church
    https://achurch.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.