Rewrite __fish_complete_proc

- No longer uses sed, sort, uniq, uname
- Stop doing too-clever filtering (e.g. the kernel thread stuff never
- really worked)
- Don't truncate for all OSen, instead just use the (correctly
- truncated) comm field.
This commit is contained in:
Fabian Homborg
2018-11-22 15:23:05 +01:00
parent 3a835ebd61
commit 60fa9da3a7
2 changed files with 7 additions and 50 deletions

View File

@@ -1,9 +1,6 @@
function __fish_complete_pgrep -d 'Complete pgrep/pkill' --argument-names cmd
# Some implementations only track the first X characters of a process name
# (with linux having the lowest X = 15).
# Just cut at 15 for all, and put the rest in the description.
complete -c $cmd -xa '(__fish_complete_proc | string replace -r "(.{15})(.+)" "\$1\\t\$2")'
complete -c $cmd -xa '(__fish_complete_proc)'
complete -c $cmd -s f -d 'Match pattern against full command line'
complete -c $cmd -s g -d 'Only match processes in the process group' -xa '(__fish_complete_list , __fish_complete_groups)'
complete -c $cmd -s G -d "Only match processes whose real group ID is listed. Group 0 is translated into $cmd\'s own process group" -xa '(__fish_complete_list , __fish_complete_groups)'