When I type
cd l
and hit tab, zsh autocompletes to
cd lightdm/
this is not a directory that is available to me (in fact I've uninstalled lightdm).
How do I stop this from happening?
I have prezto installed.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityWhen I type
cd l
and hit tab, zsh autocompletes to
cd lightdm/
this is not a directory that is available to me (in fact I've uninstalled lightdm).
How do I stop this from happening?
I have prezto installed.
This is probably the combination of the AUTO_NAME_DIRS
and CDABLE_VARS
options documented in zshoptions(1)
.
% PS1='%# ' zsh -f
% setopt AUTO_NAME_DIRS
% setopt CDABLE_VARS
% autoload -U compinit
% compinit
% cd a # was mashing tab here to no avail (nor asdf)
cd: no such file or directory: a
% hash -d asdf=/etc
% cd asdf/ # "cd a" now tab completes
(This was discovered by searching zshoptions
for "dir" and "cd" related strings.)
To turn this off disable one or more of those options (unsetopt
) or remove the variable(s) that the completion code is finding.
As user thrig
has already mentioned in his answer, this was caused by CDABLE_VARS
option being set.
I had a similar issue and fixed it by adding
unsetopt CDABLE_VARS
line to my .zshrc
I ended up looking into .zhistory
and deleting all references to lightdm
this solved the problem for me. There maybe be other places zsh stores completions, but I don't know what they are.