The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: George Michaelson <ggm@algebras.org>
To: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] Why does shell write to stderr?
Date: Fri, 8 Apr 2022 08:30:01 +1000	[thread overview]
Message-ID: <CAKr6gn0Nhn+YDtrmu_3SEphC_L879vcmvB_qkQUm8NPfJ-ND7A@mail.gmail.com> (raw)
In-Reply-To: <CAKzdPgxhEZNihmag-GcDsWLhD1xW9XzO1tYSja=W3kPC=9kGQA@mail.gmail.com>

I also had extreme WTF the first time I looked in code and saw an
isatty() guard over some activity.

"this program processes stdin to stdout, except.. if I decide
otherwise" never appeared in man pages.

But that said, it sort of made sense. Why ring bell in an editor, if
you know the input pipe side can't hear it? A tty is a rather strange
device being the join over stdout, stdin and stderr, and there is a
(tiny?) set of things which need to know.

more for instance, probably needs to know that waiting for a command
to move pagination onward if there is no controlling terminal is not
sensible. If you want your input in chunks, more is not the way to do
it.

I hate special cases. This is why people say english is so hard to
learn but really all languages have them, its just that english having
stolen words from everywhere has more instances of isatty() than
others.

-G

  reply	other threads:[~2022-04-07 22:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 21:11 Douglas McIlroy
2022-04-07 21:32 ` Steffen Nurpmeso
2022-04-07 21:36 ` Richard Salz
2022-04-07 22:15   ` Rob Pike
2022-04-07 22:30     ` George Michaelson [this message]
2022-04-07 23:51       ` Rob Pike
2022-04-09  1:46         ` John Cowan
2022-04-09  1:53           ` George Michaelson
2022-04-09 18:05           ` Steffen Nurpmeso
  -- strict thread matches above, loose matches on Subject: below --
2022-04-08  9:34 Paul Ruizendaal via TUHS
2022-04-07 17:45 Richard Salz

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=CAKr6gn0Nhn+YDtrmu_3SEphC_L879vcmvB_qkQUm8NPfJ-ND7A@mail.gmail.com \
    --to=ggm@algebras.org \
    --cc=tuhs@minnie.tuhs.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;
as well as URLs for NNTP newsgroup(s).