From 9897ee959186f2c8d5908966c10cb6593df945a1 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 20 Feb 2020 16:36:59 +0900 Subject: [PATCH] [bash] Strip trailing whitespace on kill completion --- shell/completion.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/completion.bash b/shell/completion.bash index 47d01e8..b953cc8 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -233,6 +233,7 @@ _fzf_complete_kill() { local selected selected=$(command ps -ef | sed 1d | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-50%} --min-height 15 --reverse $FZF_DEFAULT_OPTS $FZF_COMPLETION_OPTS --preview 'echo {}' --preview-window down:3:wrap" __fzf_comprun "kill" -m | awk '{print $2}' | tr '\n' ' ') + selected=${selected% } printf '\e[5n' if [ -n "$selected" ]; then