do not execute external command in pkill completions (#4586)

Running "cut" multiple times in a loop has an adverse performance
impact on first use, especially on slow systems. Using builtin "read"
for the same purpose is faster and cleaner.
This commit is contained in:
Aleksey Filippov 2017-12-11 05:56:29 +00:00 committed by ridiculousfish
parent c077aae022
commit 4bcd0413f8

View File

@ -2,8 +2,7 @@
__fish_complete_pgrep pkill
__fish_make_completion_signals
for i in $__kill_signals
set number (echo $i | cut -d " " -f 1)
set name (echo $i | cut -d " " -f 2)
echo $i | read number name
complete -c pkill -o $number -d $name
complete -c pkill -o $name -d $name
end