Run bg-transform callbacks during wait instead of dropping them

Wait-block guard returned early for all actions but abort/cancel,
silently discarding actAsync so bg-transform results completing mid-wait
were lost. Let actAsync through since it's unrelated to the wait.
This commit is contained in:
Junegunn Choi
2026-07-02 14:54:41 +09:00
parent 4db322146c
commit c6d4a13cb4
2 changed files with 14 additions and 2 deletions
+9
View File
@@ -1185,6 +1185,15 @@ class TestCore < TestInteractive
tmux.until { |lines| assert_equal 1, lines.match_count }
end
def test_wait_action_bg_transform
# A bg-transform result is unrelated to the wait, so it's applied while the
# wait is still blocking rather than dropped. The long read keeps the wait
# blocked so the (instant) bg-transform completes during the block; the
# header must show while '(..)' is still displayed.
tmux.send_keys %((seq 100; sleep 2) | #{FZF} --bind 'start:bg-transform-header(echo hello)+search(5)+wait'), :Enter
tmux.until { |lines| assert(lines.any_include?('(..)') && lines.any_include?('hello')) }
end
def test_clear_selection
tmux.send_keys %(seq 100 | #{FZF} --multi --bind space:clear-selection), :Enter
tmux.until { |lines| assert_equal 100, lines.match_count }