Skip to content

fix(test): close echo race in the kitty detach integration test#10

Merged
kylecarbs merged 1 commit into
mainfrom
fix-kitty-test
Jun 10, 2026
Merged

fix(test): close echo race in the kitty detach integration test#10
kylecarbs merged 1 commit into
mainfrom
fix-kitty-test

Conversation

@kylecarbs

Copy link
Copy Markdown
Member

The kitty keyboard apps: encoded C-a still detaches test failed in the v0.3.0 release pipeline with a timeout. waitFor("KITTY-APP") matched the tty echo of the typed printf command (the marker appeared literally in the command line), so on a slow runner the CSI-u detach keys were sent before the app enabled kitty keyboard mode, leaked into the window, and no detach ever happened.

Fix: assemble the marker from two printf arguments (KITTY-%s + APP) so the echoed command never contains it, and print it after the \033[>1u enable so the marker becoming visible implies the daemon already processed the enable (same output chunk, enable first).

Test-only change; shipped binaries are unaffected.

Decision log
  • Same two-argument printf trick the title-restore test already uses to keep markers out of echoed command lines.
  • Ordering the enable before the marker removes the remaining theoretical chunk-split race; the daemon feeds terminal state before forwarding within one chunk.
  • Audited the other raw send callsites: the cat/canvas roundtrips wait for the echo on purpose; no other test gates on output that also appears in its typed command.

Testing

  • zig build test-all (Debug): 67/67 pass; integration suite run 3 more consecutive times clean.

Generated with Coder Agents on behalf of @kylecarbs.

waitFor(KITTY-APP) could match the tty echo of the typed printf
command, since the marker appeared literally in the command line.
On slow runners the detach keys were then sent before the app
enabled kitty keyboard mode, leaked into the window, and the test
timed out waiting for a detach that never happened.

Assemble the marker from two printf arguments so the echo never
contains it, and print it after the kitty enable so visibility of
the marker implies the daemon has processed the enable.
@kylecarbs kylecarbs merged commit 6ff8d8d into main Jun 10, 2026
4 checks passed
@kylecarbs kylecarbs deleted the fix-kitty-test branch June 10, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant