diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Completion/Unix/Command/_pgrep | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog index 79dddba67..335e42ff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 51a4883df..5b1853e6b 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -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 |