Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: New problem with ERR_RETURN ?
- X-seq: zsh-workers 51123
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: New problem with ERR_RETURN ?
- Date: Wed, 7 Dec 2022 17:07:42 +0000 (GMT)
- Archived-at: <https://zsh.org/workers/51123>
- Importance: Normal
- In-reply-to: <CAH+w=7bjQpgax4ChmmzWVrhUBDUKeq-0JVzCzqqNpO-wdwskAQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7Y-rW_Lid-2F1JK+UC+2tG2F7yPfcguC86-sWR0MpG+-g@mail.gmail.com> <CAGdYchvWXmsLZ_ohhdZsqy=1tTR2R25uHKi=vuqNu9uMA7MP=Q@mail.gmail.com> <1294443392.2122422.1670431987664@mail.virginmedia.com> <CAH+w=7bjQpgax4ChmmzWVrhUBDUKeq-0JVzCzqqNpO-wdwskAQ@mail.gmail.com>
> On 07/12/2022 17:02 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Wed, Dec 7, 2022 at 8:55 AM Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> wrote:
> >
> > +
> > +It should also be noted that this option forces an immediate
> > +return to the command prompt when the non-zero status occurs
> > +in a sequence of commands typed on the command line. In other
> > +words, the sequence of commands typed by the user may be
> > +thought of as a script for this purpose.
>
> Um, no, it doesn't return to the prompt, it kills the shell.
Yes, that would presumably require testing with a different
option, wouldn't it?
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 445052617..b2213eb44 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -1744,6 +1744,9 @@ Exiting due to tt(ERR_EXIT) has certain interactions with asynchronous
jobs noted in
ifzman(the section JOBS in zmanref(zshmisc))\
ifnzman(noderef(Jobs & Signals)).
+
+Note this behaviour is not disabled in interactive shells ---
+a non-zero status on the command line causes the shell to exit.
)
pindex(ERR_RETURN)
pindex(NO_ERR_RETURN)
@@ -1772,6 +1775,12 @@ function, code inside it is considered separately: it may force a return
from tt(summit) (assuming the option remains set within tt(summit)), but
not from the enclosing context. This behaviour is different from
tt(ERR_EXIT) which is unaffected by function scope.
+
+It should also be noted that this option forces an immediate
+return to the command prompt when the non-zero status occurs
+in a sequence of commands typed on the command line. In other
+words, the sequence of commands typed by the user may be
+thought of as a function for this purpose.
)
pindex(EVAL_LINENO)
pindex(NO_EVAL_LINENO)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author