1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-24 17:21:08 +02:00

48891: Fix pgrep/pkill -f completion

Old completion produced false positives & took too much screen space.
This commit is contained in:
Marlon Richert 2021-05-21 15:56:42 +03:00 committed by Oliver Kiddle
parent e732073415
commit 891d361572
2 changed files with 12 additions and 2 deletions

View file

@ -1,5 +1,8 @@
2021-05-21 Oliver Kiddle <opk@zsh.org>
* Marlon Richert: 48891: Completion/Unix/Command/_pgrep:
Fix pgrep/pkill -f completion
* Marlon Richert: 48864: Completion/Zsh/Type/_parameters: Improve
extra-verbose completion display strings for array parameter values

View file

@ -166,8 +166,15 @@ case $state in
ispat=""
fi
if (( ${+opt_args[-f]} )); then
_wanted process-args expl $ispat'process command line' \
compadd ${${(f)"$(_call_program process-args ps -A -o args=)"}% *}
local -a matches=( ${(f)"$(
_call_program process-args pgrep -lf ${${:-$PREFIX$SUFFIX}:-.\*}
)"} )
local -a displ=( "${${matches[@]//':'/'\:'}[@]/ /:}" )
matches=( "${matches[@]##<-> }" )
local desc=$ispat'process command line'
_description process-args expl "$desc"
_describe -t process-args "$desc" displ matches "$@" -U "$expl[@]"
else
_wanted processes-names expl $ispat'process name' _process_names -a -t
fi