1

I use zsh. For some reason, with zsh, when I type open <TAB> (which should list the files to autocompletion), it opens Finder in the current folder.

I don't have anything aliased for that. I didn't change any config recently. I don't have any idea about why this is happening. Bash works, though.

Any ideas on how can I fix or debug that?

0

3 Answers 3

0

I can not reproduce this issue, so it should not happen by default. TAB works as expected in zsh (as in bash). What version of OSX are you using? This is in a standard terminal window right? Do you have something in your .zshrc file relating to custom completion settings?

Try deleting your .zshrc file and run the zsh shell again,

mv .zshrc .zshrc.old
zsh

This should fix your issue.

0

You can enable debug mode in ZSH using the -vx flags.

Open up terminal, and create a new ZSH instance:

zsh -vx

Then, try your

open <tab>

It should print out everything it's trying to match on, and any processing it's doing. Might give you a clue as to which setting is influencing this behaviour. I can't replicate on mine.

0

Found the problem.

which open always shown /usr/bin/open, but which _open showed me this:

_open() {
   if [ "$(uname -s)" = "Darwin" ]; then
     open "$1" 2> /dev/null
   else
     xdg-open "$1" &> /dev/null
   fi
 }

Which was declared by a plugin that I was using.

Functions prefixed with _ are used as autocompletion functions, and that's why my open autocompletion was broken.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .