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

Re: zsh doesn't complete for tar, zip, possibly other files



On Tue, 15 Mar 2011, Lewis Thompson wrote:

partlow ~ % tar xvf [hammering TAB]

So clearly completion is trying to do something.  Other useful info:

If you type <ctrl+x><h> at the point where you're hammering TAB, you'll get some debugging information that could be useful.


I believe these are all of my completion settings in .zshrc:

[...]
zstyle ':completion:*' matcher-list '' 'l:|=* r:|=*' 'r:|[._-]=**
r:|=**' 'm:{[:lower:][:up
per:]}={[:upper:][:lower:]}'

I assume this was mangled by mailing (extra newlines)? But, even that line when demangled, along with this other line you listed:

zstyle ':completion:*' file-sort access

causes the problems you describe. I have no idea what that matcher-list is trying to do, but this is a full, reproducible test-case for me:

==> badzshrc <==
zstyle ':completion:*' file-sort access
zstyle ':completion:*' matcher-list '' 'l:|=* r:|=*' 'r:|[._-]=** r:|=**' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
autoload -Uz compinit
compinit
================

$ zsh -f
$ . ./badzshrc
$ tar xvf [Tab]

At that point, ^xh produces:

tags in context :completion::complete:tar::
    globbed-files  (_files _tar_archive _tar (eval))

Whereas the working case produces:

tags in context :completion::complete:tar::
    globbed-files  (_files _tar_archive _tar (eval))
    directories    (_files _tar_archive _tar (eval))
    all-files      (_files _tar_archive _tar (eval))

--
Best,
Ben



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