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

Re: zsh function breaks after error



On Thu, Feb 10, 2022 at 5:20 PM Thomas Lauer <thomas.lauer@xxxxxxxxxx> wrote:
>
> > From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
> >
> > What happens if you add `emulate -L zsh` (without quotes) at the top of the
> > function?
>
> Something good happens... it now works as I'd expect! Thanks, will have
> to read up about this!

This means that err_return option is set in your interactive zsh. This
is likely the result of invoking a function that has `setopt
err_return` in it without `emulate -L zsh` and without `setopt
local_options`. That function needs to be fixed. For example, you
could replace `setopt err_return` with `emulate -L zsh -o err_return`.

You can read about zsh options and `emulate -L` here:
https://zsh.sourceforge.io/Doc/Release/Options.html

Roman.




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