UPDATE 3 I've worked out that these annoying autocomplete options are actually usernames. I.e. they exist in /etc/passwd
I have users such as _kadmin_admin and _kadmin_changepw and many others starting with an underscore. This may be specific to OSX.
Oh-my-zsh is autocompleting with these usernames when it can't find any other matches. I tried adding these usernames to the "Don't complete uninteresting users" list in ~/.oh-my-zsh/lib/completion.zsh
, but that didn't work. I'm not sure why?
Is there anyway to stop oh-my-zsh from autocompleting usernames?
I'm getting frustrated by some weird behaviour in either ZSH or oh-my-zsh. I'm not sure which would be causing it.
The autocomplete seems to be searching some weird directories that I don't want it to. They appear to be some SVN directories, that I know nothing about and have no idea why they would be in the path. (I don't even use SVN)
This behaviour only seems to occur if there are no other matches in the current directory - it must then look in some other path that I have no idea about.
Example:
NOTE: There is nothing in my home dir that matches mi
→ ~ cd mi<tab>
→ ~ cd _kadmin
I.e. it turns mi
into _kadmin
. I have no idea why it is matching that directory.
If I try to actually change into that directory, I get an error anyway (as it is not the full directory name):
→ ~ cd _kadmin
cd:cd:10: no such file or directory: _kadmin
If I keep pressing <tab>
then it will match the full directory name:
→ ~ cd mi<tab><tab><tab>
→ ~ cd kadmin_admin
→ ~_svn
→ ~_svn pwd
/var/empty
I have no idea what is going on there. I have no idea what kadmin_admin is. And why when I change into it, why would I now get a directory name of ~_svn
, and then if I PWD
it shows /var/empty
This is my path:
/Users/asgeo1/.rvm/gems/ruby-1.9.3-p194/bin:/Users/asgeo1/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/asgeo1/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/asgeo1/.rvm/bin:/usr/local/php54/bin:/Users/asgeo1/Projects/dotfiles/bin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
Nothing obvious in there that I can see.
Please someone shed some light on this. It's quite frustrating me!
EDIT: Seems someone has had a similar issue before: Stop tab completion suggesting 'messagebus' There are no answers on there though :(
UPDATE: This is the cd function which oh-my-zsh applies:
→ ~ which cd
cd () {
if [[ "x$*" = "x..." ]]
then
cd ../..
elif [[ "x$*" = "x...." ]]
then
cd ../../..
elif [[ "x$*" = "x....." ]]
then
cd ../../..
elif [[ "x$*" = "x......" ]]
then
cd ../../../..
else
builtin cd "$@"
fi
}
cd
with a function. Try running zsh without one of them: does the problem persist? What is thecd
function and where is it coming from? Is there aCDPATH
? – Gilles 'SO- stop being evil' Dec 2 '12 at 23:56cd
function. Have pasted it above. I also ran zsh without oh-my-zsh, and it did not have the same problem. So I think you could be right. There is no CDPATH set either. – asgeo1 Dec 3 '12 at 4:15