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

Re: New problem with ERR_RETURN ?



> On 07/12/2022 16:41 Philippe Altherr <philippe.altherr@xxxxxxxxx> wrote:
> I don't think there is a problem. At least not a new problem because Zsh 5.8 and Zsh dev behave the same way.
> 
> Note that if you replace the body of "f" with just "false" you get the same results.

Yes, you're correct.  We should probably document this somehow.

pws

diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 445052617..dbaab08f4 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -1744,6 +1744,12 @@ 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)).
+
+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.
 )
 pindex(ERR_RETURN)
 pindex(NO_ERR_RETURN)
@@ -1772,6 +1778,9 @@ 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.
+
+Like tt(ERR_EXIT), this option forces an immediate return to the
+command prompt in interactive shells.
 )
 pindex(EVAL_LINENO)
 pindex(NO_EVAL_LINENO)




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