From 302e21fd5813a3c4c7f6014367988829fc92770a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 1 Apr 2023 19:52:34 +0900 Subject: [PATCH] [shell] Update kill completion * Explicitly specify the list of fields for consistent experience * Add fallback command for BusyBox (Close #3219) * Apply `--header-lines=1` to show the column header --- shell/completion.bash | 5 +++-- shell/completion.zsh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shell/completion.bash b/shell/completion.bash index 836f4b54..9474ea03 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -270,8 +270,9 @@ _fzf_complete_kill() { } _fzf_proc_completion() { - _fzf_complete -m --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <( - command ps -ef | sed 1d + _fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <( + command ps -eo user,pid,ppid,start,time,command 2> /dev/null || + command ps -eo user,pid,ppid,time,args # For BusyBox ) } diff --git a/shell/completion.zsh b/shell/completion.zsh index 807d7b3a..bb256d99 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -251,8 +251,9 @@ _fzf_complete_unalias() { } _fzf_complete_kill() { - _fzf_complete -m --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <( - command ps -ef | sed 1d + _fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <( + command ps -eo user,pid,ppid,start,time,command 2> /dev/null || + command ps -eo user,pid,ppid,time,args # For BusyBox ) }