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

Re: buggy completion for zsh [TAB]



On Apr 3,  4:38pm, Vincent Lefevre wrote:
}
} ypig% zsh [TAB]
} shows all the files in the working directory.
} 
} ypig% zsh foo[TAB]
[shows files and commands beginning with "foo"]

This is because _sh always falls through to _default when there are no
arguments already on the command line, instead of taking the path where
_alternative is called for files and commands which it does when there
is at least one (partial) argument.

} ypig% zsh foob[TAB]
} foobar
} 
} which is not expected when the completion is unique.
} 
} [In] any case, following [TAB]'s have no effect.

This seems to be happening because of the initial call to _arguments that
is done by _sh only in the zsh case.  This leaves the completion seeming
to be "ambiguous".  If I simply move the [[ $service == zsh ]] block to
the end of _sh, things get a lot more sensible (but there's probably some
state saving/returning that needs to be added as well).

Also as it stands, after

% zsh foobar [TAB]

the options of zsh are completed even though they're no longer valid in
that position.

-- 
Barton E. Schaefer



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