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

Re: [PATCH] _ssh_hosts: abort early if in a path



On 2019-05-29 at 22:57 +0900, Jun-ichi Takimoto wrote:
> > 2019/05/28 8:33、Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>のメール:
> > 
> > +case "$PREFIX" in
> > +  ( /* | ./* )
> > +    return
> > +    ;;
> > +esac
> 
> Isn't it better to "return 1"?

Doesn't seem to make any difference to the ssh family completions or to
git, but the docs seem to suggest that you're right, and `return 1` is
better.

> _ssh_hosts (before your patch) does not return 1 even if it can't 
> find any matches. Maybe better to fix this also?

If someone else wants to start an audit of the shipped completion
functions and their return statuses, then that's great.  Perhaps there's
some future optimizations which could be made if more of the completion
system cared about return codes.

But for me: the patch I offered (possibly modified to return 1) makes a
significant difference to performance and usability of zsh when copying
files between hosts.  That's the patch I'm offering for consideration:
small; simple to analyse; with clear results.

-Phil



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