Ubuntu: zsh auto completes non-executable files in $PATH when press TAB


I'm using oh-my-zsh, along with some custom scripts that automatically add sub-directories under specific folder to PATH. Taking android studio for example, assume ~/android-studio/bin is included in PATH, press TAB after studio, zsh gives hint:

➜  ~ studio  studio64.vmoptions  studio.png          studio.sh           studio.vmoptions    ➜  bin ll studio*  -rw-r--r-- 1 j j  559 May  26 13:44 studio64.vmoptions  -rw-r--r-- 1 j j 9.6K May  26 13:44 studio.png  -rwxr-xr-x 1 j j 6.7K May  26 13:44 studio.sh  -rw-r--r-- 1 j j  566 May  26 13:44 studio.vmoptions  

obviously only studio.sh is the executable that I wanted. Is there any option to prevent zsh auto complete non-executable commands?

UPDATE: tpye studio in home then CTRL+X h:

➜  ~ studio  tags in context :completion::complete:-command-::      commands builtins functions aliases suffix-aliases reserved-words jobs parameters  (_command_names _autocd)       commands                                                                           (_path_commands _command_names _autocd)       jobs                                                                               (_jobs _command_names _autocd)       parameters                                                                         (_parameters _command_names _autocd)       local-directories                                                                  (_cd _autocd)  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »