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

Re: Slow completion when using aptitude



On Wed, Jan 26, 2011 at 4:35 PM, Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx> wrote:
> [snip]
> _aptitude does more than _apt-get. If the second <tab> doesn't take as
> long as the first, you probably got caching enabled via zstyle.

So the problem is, as I understand, the cache for apt-get is
persistent, while that of aptitude isn't. It seems that I have done
nothing special about them, and the following is a snippet of my
.zshrc:

# The following lines were added by compinstall

zstyle ':completion:*' file-sort name
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}'
'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select=1
zstyle ':completion:*' select-prompt '%SScrolling active: current
selection at %p%s'
zstyle :compinstall filename '/home/xiaq/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install

To make things more clear, I tried the following:

xiaq@~> zsh -f
xiaq@~> autoload -Uz compinit && compinit

to get a minimal zsh environment with tab-completion enabled. The
result is still the same.

> [snip]
> Are you sure you don't have two competing versions of zsh installed?
> Then it may be possible that "print $ZSH_VERSION" and "zsh --version"
> would yield different results.

I did install the version from Ubuntu repo, but now I have already removed it.

xiaq@~> which -a zsh
/usr/local/bin/zsh

Could you check whether "aptitude -h" on your system mentions
build-dep? That of my system (Ubuntu 10.04) doesn't; while apt-get
does:

xiaq@~> aptitude -h | grep build
[no result]
xiaq@~> apt-get | grep build
  build-dep - Configure build-dependencies for source packages


I doubt whether zsh's tab-completion of aptitude's(and other
utilities') verbs works by looking at "aptitude -h" first to generate
the verbs list. If so, the problem should be considered a bug of
aptitude that ships with Ubuntu 10.04 instead of zsh. (This has been
confirmed, so this minor bug belongs to aptitude instead of zsh.)



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