From 4bcd0413f8a64bbd5d4924a162d346111a644fe9 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Mon, 11 Dec 2017 05:56:29 +0000 Subject: [PATCH] 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. --- share/completions/pkill.fish | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/completions/pkill.fish b/share/completions/pkill.fish index 225f6d8ee..00e350b94 100644 --- a/share/completions/pkill.fish +++ b/share/completions/pkill.fish @@ -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