From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: [BUG] zsh dies in case of EIO with echo in .zlogout / ENOTTY
Date: Mon, 12 Jul 2021 18:46:21 +0200 [thread overview]
Message-ID: <CAHYJk3QANeZcbEUyBAuenL7o1RrNN1eXM6-YV3CZbUJmBfuH7g@mail.gmail.com> (raw)
In-Reply-To: <20210712100224.GA9599@cventin.lip.ens-lyon.fr>
On 7/12/21, 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
If you're looking for a workaround in the meantime, I think this will
work (didn't test in .zlogout)
{ } always {
your actual code here
}
eg with Peter's example,
exec 2>&-
{ } always {
echo e2 >&2
echo hi
}
. ./source.zsh prints hi
--
Mikael Magnusson
prev parent reply other threads:[~2021-07-12 16:46 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
2021-07-12 16:46 ` Mikael Magnusson [this message]
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=CAHYJk3QANeZcbEUyBAuenL7o1RrNN1eXM6-YV3CZbUJmBfuH7g@mail.gmail.com \
--to=mikachu@gmail.com \
--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).