diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a8519..31c9b82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ CHANGELOG ``` - Use SGR mouse mode to support larger terminals - Bug fixes and improvements +- Shell extension + - `kill` completion now requires trigger sequence (`**`) for consistency 0.30.0 ------ diff --git a/README.md b/README.md index 92eab8b..d8e11af 100644 --- a/README.md +++ b/README.md @@ -382,12 +382,11 @@ cd ~/github/fzf** #### Process IDs -Fuzzy completion for PIDs is provided for kill command. In this case, -there is no trigger sequence; just press the tab key after the kill command. +Fuzzy completion for PIDs is provided for kill command. ```sh # Can select multiple processes with or keys -kill -9 +kill -9 ** ``` #### Host names diff --git a/shell/completion.bash b/shell/completion.bash index 681c89f..b1e7935 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 f12afca..2577eac 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 diff --git a/test/test_go.rb b/test/test_go.rb index 3050fa0..d64df31 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2478,7 +2478,7 @@ module CompletionTest pid = lines[-1]&.split&.last tmux.prepare tmux.send_keys 'C-L' - tmux.send_keys 'kill ', :Tab + tmux.send_keys 'kill **', :Tab tmux.until { |lines| assert_operator lines.match_count, :>, 0 } tmux.send_keys 'sleep12345' tmux.until { |lines| assert lines.any_include?('sleep 12345') }