a73x

32e5b24c

scenarios: make blink-bar fixture render visible content

a73x   2026-04-19 14:05

Commit message
scenarios: make blink-bar fixture render visible content

Previous fixture wrote only DECSCUSR 5 (cursor shape change)
against an empty terminal. Both goldens were technically
distinct (cursor-on vs cursor-off) but visually near-blank
— 2px of cursor against 800x480 of black.

New fixture writes a demo banner + prompt BEFORE setting
cursor shape, so both goldens show identifiable content.
The cursor column remains the only pixel difference between
frames; the mutation-detection pipeline still works.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

tests/scenarios/blink-bar.scenario
Old New
@@ -1,14 +1,28 @@
1 # Blinking bar cursor: DECSCUSR 5 then observe two phases. 1 # Blinking bar cursor over visible content.
2 #
3 # Writes a demo banner + a prompt-like line, then switches cursor
4 # shape to blinking bar and captures two frames 500ms apart. The
5 # cursor column is the only pixel difference between frames, but
6 # both frames show identifiable content so a human can tell what
7 # was captured.
2 size 80 24 8 size 80 24
3 timeout 5000ms 9 timeout 5000ms
4 10
5 # Inject DECSCUSR 5 directly (no shell) - blinking bar. 11 # Banner line + newline.
6 bytes "\e[5 q" 12 bytes "=== waystty scenario runner demo ===\r\n"
13 # Prompt-like line — cursor will sit at column 2 after this.
14 bytes "$ "
7 15
8 # Give blink state machine time to arm. 16 # Settle.
9 sleep 100ms 17 sleep 100ms
18
19 # Switch to blinking bar cursor (DECSCUSR 5).
20 bytes "\e[5 q"
21 sleep 100ms
22
23 # Arm check: cursor should be on now (first phase of 500ms arm).
10 capture before-flip 24 capture before-flip
11 25
12 # Advance past the first phase flip (500ms period). 26 # Advance past the first phase flip.
13 sleep 500ms 27 sleep 500ms
14 capture after-flip 28 capture after-flip
tests/scenarios/golden/blink-bar/after-flip.png
Old New
Binary file
Binary files differ
tests/scenarios/golden/blink-bar/before-flip.png
Old New
Binary file
Binary files differ