__fish_complete_pgrep: Truncate to 15 characters

Fixes #4132.
This commit is contained in:
Fabian Homborg 2018-10-25 12:08:54 +02:00
parent 5ad292328a
commit fb0c1460a9

View file

@ -1,6 +1,9 @@
function __fish_complete_pgrep -d 'Complete pgrep/pkill' --argument-names cmd function __fish_complete_pgrep -d 'Complete pgrep/pkill' --argument-names cmd
complete -c $cmd -xa '(__fish_complete_proc)' # 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 -s f -d 'Match pattern against full command line' 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 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)' 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)'