zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: [BUG] zsh dies in case of EIO with echo in .zlogout / ENOTTY
Date: Wed, 14 Jul 2021 10:04:21 +0200	[thread overview]
Message-ID: <20210714080421.GA2423666@zira.vinc17.org> (raw)
In-Reply-To: <1681826594.99933.1626092000365@mail2.virginmedia.com>

On 2021-07-12 13:13:20 +0100, Peter Stephenson wrote:
> That's equivalent to this:
> 
> % cat source.zsh
> exec 2>&-
> echo Exiting2 >&2
> echo Exiting
> % ./zsh
> % . ./source.zsh
> <no output>
> %
> 
> The inability to write to stderr to report the error writing to stderr
> (I think, so not the original error on the *request* to write to stderr,
> the fact it couldn't report the error) is treated as a hard error and causes
> the sourced script to fail at that point.
> 
> Not sure what the right answer is.  We've also been looking at complaints that
> zsh doesn't take errors with echo seriously enough...

I'd say that returning with a non-zero exit status is sufficient.
If the user wants the script to terminate after an error, he can
test the exit status or use "set -e". I don't see why the fact
that echo is a builtin should be treated differently.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


  reply	other threads:[~2021-07-14  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 10:02 Vincent Lefevre
2021-07-12 12:13 ` Peter Stephenson
2021-07-14  8:04   ` Vincent Lefevre [this message]
2021-07-12 16:46 ` Mikael Magnusson

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=20210714080421.GA2423666@zira.vinc17.org \
    --to=vincent@vinc17.net \
    --cc=zsh-workers@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).