bash: CTRL-R now supports multi-select and batch deletion
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled

- Changed +m to --multi to enable multi-select in CTRL-R
- Changed exclude to exclude-multi and {1} to {+1} so
  shift-delete removes all selected entries at once
This commit is contained in:
Junegunn Choi
2026-03-21 21:41:22 +09:00
parent 76efddd718
commit a00df93e13
3 changed files with 13 additions and 8 deletions

View File

@@ -840,20 +840,25 @@ class TestBash < TestBase
tmux.prepare
tmux.send_keys 'echo to-delete-2', :Enter
tmux.prepare
tmux.send_keys 'echo to-delete-3', :Enter
tmux.prepare
tmux.send_keys 'echo another-keeper', :Enter
tmux.prepare
# Open Ctrl-R and delete two entries
# Open Ctrl-R and delete one entry
tmux.send_keys 'C-r'
tmux.until { |lines| assert_operator lines.match_count, :>, 0 }
tmux.send_keys 'to-delete'
tmux.until { |lines| assert_equal 2, lines.match_count }
# Delete the first match
tmux.until { |lines| assert_equal 3, lines.match_count }
tmux.send_keys 'S-Delete'
tmux.until { |lines| assert_equal 1, lines.match_count }
# Delete the second match
tmux.until { |lines| assert_equal 2, lines.match_count }
# Multi-select remaining two and delete them at once
tmux.send_keys :BTab, :BTab
tmux.until { |lines| assert_includes lines[-2], '(2)' }
tmux.send_keys 'S-Delete'
tmux.until { |lines| assert_equal 0, lines.match_count }
# Exit without selecting
tmux.send_keys :Escape
tmux.prepare