zsh-workers
 help / color / mirror / code / Atom feed
From: "Lawrence Velázquez" <larryv@zsh.org>
To: Marlon Richert <marlon.richert@gmail.com>
Cc: Mikael Magnusson <mikachu@gmail.com>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] Shell option PRINT_EXIT_VALUE lost on function exit, even when LOCAL_OPTIONS is not set
Date: Fri, 25 Aug 2023 05:04:04 -0400	[thread overview]
Message-ID: <CF4DE502-DD45-4913-94CE-C80C6BCCC924@zsh.org> (raw)
In-Reply-To: <CAHLkEDvBz+ZQTgASGbzRbYQ-M8tnEm423RAqwUov1pKi6igJdw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

> On Aug 25, 2023, at 2:56 AM, Marlon Richert <marlon.richert@gmail.com> 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_LOOPS, XTRACE and PRINT_EXIT_VALUE options are restored.

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

-- 
vq
Sent from my iPhone

[-- Attachment #2: Type: text/html, Size: 1687 bytes --]

      reply	other threads:[~2023-08-25  9:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  7:54 Marlon Richert
2023-07-12 13:05 ` Mikael Magnusson
2023-08-25  6:55   ` Marlon Richert
2023-08-25  9:04     ` Lawrence Velázquez [this message]

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=CF4DE502-DD45-4913-94CE-C80C6BCCC924@zsh.org \
    --to=larryv@zsh.org \
    --cc=marlon.richert@gmail.com \
    --cc=mikachu@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).