diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2022-07-21 22:16:19 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2022-07-21 22:21:11 +0900 |
commit | 52594355bfa63ce7d579c7961f4f2fb30b486101 (patch) | |
tree | 7656923b18f295f7ab30e5fcb06f0c944aff68ce /shell | |
parent | 0d06c28b1943e820440cff9182a0ae3bdd5e3c59 (diff) |
[shell] 'kill' completion will now require trigger sequence (**)
'kill **<tab>' instead of 'kill <tab>' just like any other completions.
Close #2716
Close #385
Diffstat (limited to 'shell')
-rw-r--r-- | shell/completion.bash | 14 | ||||
-rw-r--r-- | shell/completion.zsh | 6 |
2 files changed, 2 insertions, 18 deletions
diff --git a/shell/completion.bash b/shell/completion.bash index 681c89fb..b1e79353 100644 --- a/shell/completion.bash +++ b/shell/completion.bash @@ -260,14 +260,6 @@ _fzf_dir_completion() { } _fzf_complete_kill() { - local trigger=${FZF_COMPLETION_TRIGGER-'**'} - local cur="${COMP_WORDS[COMP_CWORD]}" - if [[ -z "$cur" ]]; then - COMP_WORDS[$COMP_CWORD]=$trigger - elif [[ "$cur" != *"$trigger" ]]; then - return 1 - fi - _fzf_proc_completion "$@" } @@ -352,9 +344,6 @@ for cmd in $d_cmds; do __fzf_defc "$cmd" _fzf_dir_completion "-o nospace -o dirnames" done -# Kill completion (supports empty completion trigger) -complete -F _fzf_complete_kill -o default -o bashdefault kill - unset cmd d_cmds a_cmds _fzf_setup_completion() { @@ -377,9 +366,10 @@ _fzf_setup_completion() { done } -# Environment variables / Aliases / Hosts +# Environment variables / Aliases / Hosts / Process _fzf_setup_completion 'var' export unset _fzf_setup_completion 'alias' unalias _fzf_setup_completion 'host' ssh telnet +_fzf_setup_completion 'proc' kill fi diff --git a/shell/completion.zsh b/shell/completion.zsh index f12afca1..2577eacb 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -285,12 +285,6 @@ fzf-completion() { lbuf=$LBUFFER tail=${LBUFFER:$(( ${#LBUFFER} - ${#trigger} ))} - # Kill completion (do not require trigger sequence) - if [ "$cmd" = kill -a ${LBUFFER[-1]} = ' ' ]; then - tail=$trigger - tokens+=$trigger - lbuf="$lbuf$trigger" - fi # Trigger sequence given if [ ${#tokens} -gt 1 -a "$tail" = "$trigger" ]; then |