m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 23:33:39 -05:00

[bash] Fix --query argument of CTRL-R

Fix #1898
This commit is contained in:
Junegunn Choi
2020-02-29 11:54:05 +09:00
parent e34c7c00b1
commit b2c0413a98
2 changed files with 10 additions and 7 deletions

View File

@@ -1853,12 +1853,15 @@ module TestShell
def test_ctrl_r_abort
skip "doesn't restore the original line when search is aborted pre Bash 4" if shell == :bash && /(?<= version )\d+/.match(`#{Shell.bash} --version`).to_s.to_i < 4
tmux.send_keys 'foo'
tmux.until { |lines| lines[-1].start_with? 'foo' }
tmux.send_keys 'C-r'
tmux.until { |lines| lines[-1].start_with? '>' }
tmux.send_keys 'C-g'
tmux.until { |lines| lines[-1].start_with? 'foo' }
%w[foo ' "].each do |query|
tmux.prepare
tmux.send_keys(query)
tmux.until { |lines| lines[-1].start_with? query }
tmux.send_keys 'C-r'
tmux.until { |lines| lines[-1] == "> #{query}" }
tmux.send_keys 'C-g'
tmux.until { |lines| lines[-1].start_with? query }
end
end
def retries(times = 3)