summary refs log tree commit diff
path: root/Completion/Zsh
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-01-27 21:57:52 +0000
committerClint Adams <clint@users.sourceforge.net>2002-01-27 21:57:52 +0000
commita92fca6f8e326d72b5041281341093473f5a1fa4 (patch)
tree14e9637c7eed00e92bfc7deaeee97630bed11038 /Completion/Zsh
parentfc25322fa38b184aadefe0bd5d50e3bc06122511 (diff)
downloadzsh-a92fca6f8e326d72b5041281341093473f5a1fa4.tar.gz
zsh-a92fca6f8e326d72b5041281341093473f5a1fa4.tar.xz
zsh-a92fca6f8e326d72b5041281341093473f5a1fa4.zip
16500: don't complete executable files in the current directory if "." is not in path.
Diffstat (limited to 'Completion/Zsh')
-rw-r--r--Completion/Zsh/Type/_command_names11
1 files changed, 10 insertions, 1 deletions
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 006006348..71c3adfd2 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -8,9 +8,18 @@ local args defs
 
 defs=(
   'commands:external command:compadd -k commands'
-  'executables:executable file or directory:_path_files -/g \*\(-\*\)'
 )
 
+if [[ -n "$path[(r).]" ]]; then
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_path_files -/g \*\(-\*\)'
+  )
+else
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)'
+  )
+fi
+
 if [[ "$1" = -e ]]; then
   shift
 else