Screenshot Debugging Skill
Purpose
Diagnose terminal screenshot corruption caused by incomplete terminal-state updates.
When to Use
- SVG screenshots show stale or overlaid text.
- Live WebSocket output looks correct but
/screenshot.svgdoes not. - Issues appear with full-screen TUIs (tmux/vim/less).
Procedure
- Capture terminal bytes
- Capture PTY output around the failing action.
- Replay into the Go tracker
- Feed bytes through
internal/terminalstate(go-te based). - Confirm whether buffer state diverges from expected terminal behavior.
- Feed bytes through
- Check preprocessing/filtering
- Validate DA filtering and any partial-sequence buffering logic.
- Check dirty/refresh logic
- Verify tracker updates happen before screenshot cache decisions.
- Add regression coverage
- Add a focused Go test and (when useful) fuzz corpus seed.
- Verify
- Run
make checkand re-test the real scenario.
- Run
Notes
- Prefer reproductions from real PTY captures over synthetic minimal sequences.
- If rendering differs only in dashboard thumbnails, inspect SSE activity gating and screenshot cache TTL/invalidations.
Source: rcarmo/webterm — distributed by TomeVault.