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

local_traps doesn't restore traps set from functions



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.



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