about summary refs log tree commit diff
path: root/Completion/Zsh
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-02-03 21:29:36 +0000
committerClint Adams <clint@users.sourceforge.net>2002-02-03 21:29:36 +0000
commit050c62d36a0286afde17e63896014d6f85a529ed (patch)
tree092ee05b900d88297ffdb7db783d6bfb26daa29d /Completion/Zsh
parent45f68d770c4bde2713888a9263da1ee88a7c78ad (diff)
downloadzsh-050c62d36a0286afde17e63896014d6f85a529ed.tar.gz
zsh-050c62d36a0286afde17e63896014d6f85a529ed.tar.xz
zsh-050c62d36a0286afde17e63896014d6f85a529ed.zip
16500, 16507: have command completion respect PATH
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