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

Re: [BUG] Shell option PRINT_EXIT_VALUE lost on function exit, even when LOCAL_OPTIONS is not set



On Aug 25, 2023, at 2:56 AM, Marlon Richert <marlon.richert@xxxxxxxxx> wrote:

Fair enough, but the rest of my bug report is still valid.

The behavior you reported is documented under LOCAL_OPTIONS, although it might be helpful to mention it under PRINT_EXIT_VALUE as well.

LOCAL_OPTIONS <K>

If this option is set at the point of return from a shell function, most options (including this one) which were in force upon entry to the function are restored; options that are not restored are PRIVILEGED and RESTRICTED. Otherwise, only this option, and the LOCAL_LOOPSXTRACE and PRINT_EXIT_VALUE options are restored.

https://zsh.sourceforge.io/Doc/Release/Options.html#index-LOCAL_005fOPTIONS

-- 
vq
Sent from my iPhone


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