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

Re: Bug or Feature? Always block triggered by return in subshell within function



On Sun, May 11, 2025 at 2:38 PM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> Since their semantics are unspecified, any chance we could bring exit statements in sync (in my opinion the more always block triggered, the better) ?

It would be preferable IMO for "exit" to always exit.  If you want the
always block, use "return"; if you want exit action, use TRAPEXIT().
It's possible to write

{ something } always { TRAPEXIT }

if you want the same handling in both cases.




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