From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: local_traps doesn't restore traps set from functions
Date: Wed, 6 May 2020 15:31:47 +0200 [thread overview]
Message-ID: <CAN=4vMrq8S=W+C8Vcp_pZGkc0eNymK3d+x0E3yib6BHu5ZRhDg@mail.gmail.com> (raw)
Is this working as intended?
❯ zsh -f
adam% () { trap '' INT }
adam% () { emulate -L zsh; trap 'echo INT' INT }
adam% kill -INT $$
INT
adam%
It appears that local_traps doesn't restore traps that were originally
set from functions.
If the first trap is set from global scope, it works as expected:
❯ zsh -f
adam% trap '' INT
adam% () { emulate -L zsh; trap 'echo INT' INT }
adam% kill -INT $$
adam%
If the first trap is not set at all, it also works as expected:
❯ zsh -f
adam% () { emulate -L zsh; trap 'echo INT' INT }
adam% kill -INT $$
adam%
ZSH_PATCHLEVEL is zsh-5.8-126-gab835f0 (tip of master at the time of writing).
Roman.
next reply other threads:[~2020-05-06 13:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 13:31 Roman Perepelitsa [this message]
2020-05-07 21:21 ` Daniel Shahaf
2020-05-08 6:51 ` Roman Perepelitsa
2020-05-09 14:14 ` Daniel Shahaf
2020-05-09 15:24 ` Peter Stephenson
2020-05-09 15:42 ` Daniel Shahaf
2020-05-09 19:51 ` Daniel Shahaf
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='CAN=4vMrq8S=W+C8Vcp_pZGkc0eNymK3d+x0E3yib6BHu5ZRhDg@mail.gmail.com' \
--to=roman.perepelitsa@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).