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?



> 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