about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authordana <dana@dana.is>2021-06-14 22:19:38 -0500
committerdana <dana@dana.is>2021-06-14 22:19:38 -0500
commitc6603669a2667a4905aa4831f40e276b2c3bd4a4 (patch)
tree3f24a770460767fa73333c433a6084fbdae54d64 /Completion
parent32450b7c816159d540fe872bf7340928300aa360 (diff)
downloadzsh-c6603669a2667a4905aa4831f40e276b2c3bd4a4.tar.gz
zsh-c6603669a2667a4905aa4831f40e276b2c3bd4a4.tar.xz
zsh-c6603669a2667a4905aa4831f40e276b2c3bd4a4.zip
48920: _pgrep: Address issues related to -f completion
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_pgrep7
1 files changed, 5 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep
index 443acf3c8..38b1aebd8 100644
--- a/Completion/Unix/Command/_pgrep
+++ b/Completion/Unix/Command/_pgrep
@@ -170,10 +170,13 @@ case $state in
       ispat+="full "
     fi
     if (( ${+opt_args[-f]} )); then
+      local -a opts=( -lf )
+      [[ $OSTYPE == linux* ]] && opts=( -a )
       local -a matches=( ${(f)"$(
-              _call_program process-args pgrep -lf ${${:-$PREFIX$SUFFIX}:-.\*}
+              _call_program process-args pgrep ${(@q)opts} -- \
+                  ${(q)${${:-$PREFIX$SUFFIX}:-.\*}}
           )"} )
-      local -a displ=( "${${matches[@]//':'/'\:'}[@]/ /:}" )
+      local -a displ=( "${${matches[@]//:/\:}[@]/ /:}" )
       matches=( "${matches[@]##<-> }" )
 
       local desc=$ispat'process command line'