Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] zsh dies in case of EIO with echo in .zlogout / ENOTTY



> On 12 July 2021 at 11:02 Vincent Lefevre <vincent@xxxxxxxxxx> 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




Messages sorted by: Reverse Date, Date, Thread, Author