zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Vincent Lefevre <vincent@vinc17.net>, zsh-workers@zsh.org
Subject: Re: [BUG] zsh dies in case of EIO with echo in .zlogout / ENOTTY
Date: Mon, 12 Jul 2021 13:13:20 +0100 (BST)	[thread overview]
Message-ID: <1681826594.99933.1626092000365@mail2.virginmedia.com> (raw)
In-Reply-To: <20210712100224.GA9599@cventin.lip.ens-lyon.fr>

> On 12 July 2021 at 11:02 Vincent Lefevre <vincent@vinc17.net> wrote:
> In my .zlogout, I have an "echo" command. However, if the terminal
> is no longer there, the "echo" yields EIO errors and the remaining
> of the .zlogout is not executed, e.g. with "echo foo" in .zlogout
> and
> 
>   xterm -e strace -f -o str.out zsh -l

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...

pws


  reply	other threads:[~2021-07-12 12:13 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 [this message]
2021-07-14  8:04   ` Vincent Lefevre
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=1681826594.99933.1626092000365@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=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).