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

Re: BUG: Exit trap is not executed when error occurs in a function



On Tue, Nov 10, 2026 at 4:56 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> I'm not a maintainer, just an occasional contributor, but I think that your original mail was the right way to report the issue. However, for some reason, Gmail classified this email as spam and iirc it was the same for your original email. Maybe that explains the lack of response.

I think this is DMARC related, edp.org has a p=reject policy which is
tripped when zsh-workers forwards the email without changing the From:
header.

> What you report looks very much like a bug to me.

I haven't dug in myself but I think this is actually expected
behavior?  Return from a function is not a shell exit?  There should
be some archive messages related to the handling of ERR_EXIT vs.
ERR_RETURN.

> Strangely enough, just a few days before your original email, someone else reported a similar issue (workers/55221) where TRAPEXIT fails to execute on interruptions.

I replied to that one, it's repeatable, the "was interrupted" state
persists into the exit trap and aborts it.




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