diff --git a/src/terminal.go b/src/terminal.go index 820cc606..d91bff48 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -4831,6 +4831,10 @@ func (t *Terminal) Loop() error { if !doAction(action) { return false } + // A terminal action performed. We should stop processing more. + if !looping { + break + } } if onFocus, prs := t.keymap[tui.Focus.AsEvent()]; prs && iter < maxFocusEvents { diff --git a/test/test_filter.rb b/test/test_filter.rb index dc66ec00..ceb2c8cd 100644 --- a/test/test_filter.rb +++ b/test/test_filter.rb @@ -299,4 +299,9 @@ class TestFilter < TestBase assert_equal expected, result end end + + def test_abort_action_chain + assert_equal '1', `seq 100 | #{FZF} --bind 'load:accept+up+up'`.chomp + assert_equal '', `seq 100 | #{FZF} --bind 'load:abort+become(echo {})'`.chomp + end end