a73x

32e5b24c

scenarios: make blink-bar fixture render visible content

a73x   2026-04-19 14:05

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>

diff --git a/tests/scenarios/blink-bar.scenario b/tests/scenarios/blink-bar.scenario
index 74ee438..3df1515 100644
--- a/tests/scenarios/blink-bar.scenario
+++ b/tests/scenarios/blink-bar.scenario
@@ -1,14 +1,28 @@
# Blinking bar cursor: DECSCUSR 5 then observe two phases.
# Blinking bar cursor over visible content.
#
# Writes a demo banner + a prompt-like line, then switches cursor
# shape to blinking bar and captures two frames 500ms apart. The
# cursor column is the only pixel difference between frames, but
# both frames show identifiable content so a human can tell what
# was captured.
size 80 24
timeout 5000ms

# Inject DECSCUSR 5 directly (no shell) - blinking bar.
bytes "\e[5 q"
# Banner line + newline.
bytes "=== waystty scenario runner demo ===\r\n"
# Prompt-like line — cursor will sit at column 2 after this.
bytes "$ "

# Give blink state machine time to arm.
# Settle.
sleep 100ms

# Switch to blinking bar cursor (DECSCUSR 5).
bytes "\e[5 q"
sleep 100ms

# Arm check: cursor should be on now (first phase of 500ms arm).
capture before-flip

# Advance past the first phase flip (500ms period).
# Advance past the first phase flip.
sleep 500ms
capture after-flip
diff --git a/tests/scenarios/golden/blink-bar/after-flip.png b/tests/scenarios/golden/blink-bar/after-flip.png
index 22ac3b2..0b308ca 100644
Binary files a/tests/scenarios/golden/blink-bar/after-flip.png and b/tests/scenarios/golden/blink-bar/after-flip.png differ
diff --git a/tests/scenarios/golden/blink-bar/before-flip.png b/tests/scenarios/golden/blink-bar/before-flip.png
index 3ed3d6e..4a831d9 100644
Binary files a/tests/scenarios/golden/blink-bar/before-flip.png and b/tests/scenarios/golden/blink-bar/before-flip.png differ