Skip to content

Commit 065db68

Browse files
committed
ControlMode(core,test): Preflight attach_to and stabilize control flag/capture tests
1 parent b1e3ab8 commit 065db68

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_control_client_logs.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ def test_control_client_lists_control_flag(
119119
)
120120
proto.register_command(list_ctx)
121121
proc.stdin.write('list-clients -F"#{client_pid} #{client_flags} #{session_name}"\n')
122+
# Register detach to avoid protocol error on trailing %begin/%end
123+
detach_ctx = CommandContext(argv=["tmux", "detach-client"])
124+
proto.register_command(detach_ctx)
122125
proc.stdin.write("detach-client\n")
123126
proc.stdin.flush()
124127

@@ -129,5 +132,7 @@ def test_control_client_lists_control_flag(
129132
assert list_ctx.done.wait(timeout=0.5)
130133
result = proto.build_result(list_ctx)
131134
assert any(
132-
len(parts := line.split()) >= 2 and "C" in parts[1] for line in result.stdout
135+
len(parts := line.split()) >= 2
136+
and ("C" in parts[1] or "control-mode" in parts[1])
137+
for line in result.stdout
133138
)

0 commit comments

Comments
 (0)