Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why does _main_complete not try the next completer when $_comp_mesg is non-zero?
- X-seq: zsh-workers 48399
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Why does _main_complete not try the next completer when $_comp_mesg is non-zero?
- Date: Mon, 5 Apr 2021 13:26:11 +0300
- Archived-at: <https://zsh.org/workers/48399>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-04/D1EBCA2F-994B-4A5E-B9EC-EDD92B2CAA00%40gmail.com>
- In-reply-to: <20210403031251.GE28573@tarpaulin.shahaf.local2>
- List-id: <zsh-workers.zsh.org>
- References: <20210403031251.GE28573@tarpaulin.shahaf.local2>
> On 3. Apr 2021, at 6.12, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> I was thinking of this:
>
> _complete() {
> {
> _autocomplete._complete "$@"
> } always {
> (( $? )) && _comp_mesg=''
> }
> }
>
> Note that always blocks don't affect the overall exit code:
>
> % { (exit 42) } always { (exit 0) }; echo $?
> 42
> %
Aha. I wasn’t aware that `always` behaves that way with regards to exit status. Thanks for the tip!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author