about summary refs log tree commit diff
path: root/Completion/Zsh
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Type/_command_names6
1 files changed, 5 insertions, 1 deletions
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 006006348..613f1fe59 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -8,9 +8,13 @@ local args defs
 
 defs=(
   'commands:external command:compadd -k commands'
-  'executables:executable file or directory:_path_files -/g \*\(-\*\)'
 )
 
+[[ -n "$path[(r).]" || $PREFIX = */* ]] &&
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_path_files -/g \*\(-\*\)'
+  )
+
 if [[ "$1" = -e ]]; then
   shift
 else