zsh-workers
 help / color / mirror / code / Atom feed
* local_traps doesn't restore traps set from functions
@ 2020-05-06 13:31 Roman Perepelitsa
  2020-05-07 21:21 ` Daniel Shahaf
  0 siblings, 1 reply; 7+ messages in thread
From: Roman Perepelitsa @ 2020-05-06 13:31 UTC (permalink / raw)
  To: Zsh hackers list

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-09 19:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 13:31 local_traps doesn't restore traps set from functions Roman Perepelitsa
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

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