Skip to content
Myr

[shell] Update CTRL-R to remove duplicate commands

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Close #1940 Related: #1363 #749 #270 #49 #88 #492 #600

authored by Junegunn Choi · committed by Junegunn Choi · parent 0790468 · Browse files · 3 files+7 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+7 added−4 removed

  • tests:+5 added−2 removed
  • other:+2 added−2 removed

3 files+7 added−4 removed

modified:shell/key-bindings.bash+1 added-1 removed
modified:shell/key-bindings.zsh+1 added-1 removed
modified:test/test_go.rb+5 added-2 removed
1837 unmodified lines
1838 tmux.prepare1839 tmux.send_keys 'echo 1st', :Enter; tmux.prepare1840 tmux.send_keys 'echo 2nd', :Enter; tmux.prepare1841 tmux.send_keys 'echo 3d', :Enter; tmux.prepare1842 tmux.send_keys 'echo 3rd', :Enter; tmux.prepare1842 3.times { tmux.send_keys 'echo 3rd', :Enter; tmux.prepare }1843 tmux.send_keys 'echo 4th', :Enter1844 retries do1845 tmux.prepare1846 tmux.send_keys 'C-r'1847 tmux.until { |lines| lines.match_count.positive? }1848 end1849 tmux.send_keys 'C-r'1849 tmux.send_keys '3d'1850 # Duplicates removed: 3d (1) + 3rd (1) => 2 matches1851 tmux.until { |lines| lines.match_count == 2 }1852 tmux.until { |lines| lines[-3].end_with? 'echo 3d' }1853 tmux.send_keys 'C-r'1854 tmux.until { |lines| lines[-3].end_with? 'echo 3rd' }1855 tmux.send_keys :Enter1856 tmux.until { |lines| lines[-1] == 'echo 3rd' }1857 tmux.send_keys :Enter
359 unmodified lines