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

Re: zsh function breaks after error



On Tue, Feb 8, 2022 at 9:16 AM Thomas Lauer <thomas.lauer@xxxxxxxxxx> wrote:
>
> The trouble starts when rofi is terminated
> not via selecting one of the shown directories (exit value 0) but with
> Esc/Ctrl-G (exit value 1).
>
> In this case the function just breaks

Preface:  I have no way to test this directly, I no longer have an X
interface to play with.  However, I can't repeat this using a simpler
pipeline that exits 1 from inside the $(...).

Are you sure the exit status is 1?  Could instead for example the grep
be receiving a SIGPIPE because rofi stopped reading too soon?  I tried
to simulate that, too, but without ill effect.

Zsh does have "set +e" and "set -e" but unless -e (errexit) is in
effect from outside the function you've presented, that shouldn't
matter.




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