From 841479cb9ca522845a66f33b0e00c1438e53ac96 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 1 Apr 2026 18:56:59 -0500 Subject: [PATCH 1/2] fix(tests): fix flaky test_capture_pane_flags[join_wrapped_numbers] why: The command_complete() check matched the marker string inside the shell command echo line ($ printf ... echo "__DONE_...") before the command actually executed. On slower systems or CI, this race condition caused the test to capture the pane before seq produced output. what: - Change marker detection to skip lines starting with $ (shell prompt echo) - Marker now only matches when it appears as actual command output Fixes #654 --- tests/test_pane_capture_pane.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_pane_capture_pane.py b/tests/test_pane_capture_pane.py index 28e28648a..a18e5847f 100644 --- a/tests/test_pane_capture_pane.py +++ b/tests/test_pane_capture_pane.py @@ -356,10 +356,12 @@ def prompt_ready() -> bool: full_command = f'{command}; echo "{marker}"' pane.send_keys(full_command, literal=False, suppress_history=False) - # Wait for marker to appear + # Wait for marker to appear as command output (not in the command echo line) def command_complete() -> bool: - output = "\n".join(pane.capture_pane()) - return marker in output + lines = pane.capture_pane() + return any( + marker in line and not line.lstrip().startswith("$") for line in lines + ) retry_until(command_complete, 5, raises=True) From 7bb49f092e6b703df4fc7c27f039dd1e5ecb5af1 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 1 Apr 2026 19:03:46 -0500 Subject: [PATCH 2/2] docs(CHANGES) flaky join_wrapped_numbers test fix --- CHANGES | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 4530f8958..6e5ba3d0a 100644 --- a/CHANGES +++ b/CHANGES @@ -40,6 +40,11 @@ $ uvx --from 'libtmux' --prerelease allow python _Notes on the upcoming release will go here._ +### Bug fixes + +- Fix flaky `test_capture_pane_flags[join_wrapped_numbers]` — marker detection now + skips the shell command echo line to avoid false-positive completion (#655) + ## libtmux 0.55.1 (2026-04-19) ### Fixes