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

zsh -<TAB> dose not use menu completion

'zsh -<TAB>' does not work as I expect. With this simplest settings:

autoload -Uz compinit

if I type 'ls -<TAB><TAB>' then it goes into the menu completion. But
for 'zsh -<TAB><TAB>' or 'zsh --a<TAB><TAB>' automenu does not work.

I've tried a few other settings but I couldn't enable menu completion
for 'zsh -<TAB>'. For example, with the following settings,

zmodload zsh/complist
autoload -Uz compinit
zstyle ':completion:*' menu on select
zstyle ':completion:*' select-prompt ''    # may not be necessary

'ls -<TAB>' directly goes into the menu selection mode, but
'zsh -<TAB>' still just list the options and never goes into the menu
completion (or menu selection).

'zsh -^Xh' (_complete_help) gives

tags in context :completion::complete:zsh::
    all-files           (_files _default _sh) 
    argument-1 options  (_arguments _sh)
tags in context :completion::complete:zsh:argument-1:
    argument-1  (_message _arguments _sh)
tags in context :completion::complete:zsh:options:
    options  (_describe _arguments _sh

It seems
    argument-1 options  (_arguments _sh)
is causing the trouble, and If I specify

zstyle ':completion:*:zsh:*' tag-order options

then 'zsh -<TAB>' works as expected. Is this the only way to make menu
completion work for 'zsh -<TAB>'? If so, I feel it better to make it not
necessary for a user to specify this zstyle, but I don't know how to.

If I replace
	_arguments -S -s -- '*:'	(line 27 of _sh)
	_arguments -S -s --
then 'zsh -^Xh' gives
    options    (_arguments _sh)    # i.e., no argument-1
and 'zsh -<TAB>' works as expected without the zstyle above.
But I don't know why '*:' makes this difference.


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