Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased¶
0.2.1 - 2026-05-16¶
Fixed¶
wait_for_stablenow fingerprints the visible screen state (cell grid + active DEC modes, optionally cursor) instead of counting raw PTY byte arrivals. Any TUI with a periodic cursor blink, animated spinner, or polling status indicator previously madewait_for_stabletime out unconditionally; it now settles correctly while ignoring purely cosmetic redraws.
Added¶
wait_for_stable(ignore_cursor=True)kwarg (defaultTrue). Set toFalseto also require the cursor position / visibility to stop changing — rarely needed; cursor blink was the most common cause of the previous false negatives.
0.2.0 - 2026-05-16¶
Adds tuiwright record — an interactive wrapper that records your
session driving a TUI and generates a pytest test that codifies the
behaviour you just demonstrated.
Added¶
tuiwright recordCLI subcommand: spawns a TUI under a PTY sized to match your real terminal, transparently forwards keystrokes / mouse / resize, tees everything to an asciinema v2 cast file. Reserved Ctrl+] hotkey for snapshot / label / stop without forwarding the bytes to the TUI.tuiwright codegenCLI subcommand: turns a cast file into a complete pytest async test. Coarse-by-default style collapses runs of printable bytes intotui.type(), recognises named keys ("enter","ctrl+s","alt+left"), pretty-prints mouse events astui.click(row=N, col=N), and infers waits from the output that arrived between actions (wait_for_textwhen there's a distinctive new fragment,wait_for_stableotherwise).tuiwright replayCLI subcommand: re-runs a cast against a fresh spawn at the original timing, useful for demos and verifying recordings.- New
tuiwright._recordsubpackage withdecoders.py(reverse of_input.py),codegen.py, andbridge.py. - 61 new tests covering decoders (round-trip with encoders), codegen (syntactic validity, action emission, wait inference, snapshot markers, styles), and the bridge (end-to-end via a PTY pair).
- New docs page: Record a test, plus updates to Hello-TUI, Index, and Writing-tests guides.
0.1.0 - 2026-05-16¶
Initial release.
Added¶
TuiSessionasync driver for spawning TUI binaries under a real PTY.- Input encoders for keys, text, mouse (SGR 1006), bracketed paste, focus
events, and
TIOCSWINSZresize. Screen/Region/Cellmodel with regex search, titled-region detection (ratatui-style┌─ Title ─┐borders), and live re-resolution insidewait_for_text.- Wait primitives:
wait_for_text,wait_for_predicate,wait_for_stable. - DEC private-mode tracking for mouse / paste / focus, with a warning (or strict-mode error) when input is sent to an app that hasn't enabled the relevant mode.
- Asciinema cast v2 recording of every session.
ScreenSnapshotExtension(syrupy) for cell-grid regression as a reviewable ASCII frame plus a JSON sidecar of cell attributes.PNGSnapshotExtension(syrupy) for pixel regression viaagg+pixelmatch, with graceful degradation whenaggis unavailable.- Pytest plugin with
tuiandtui_factoryfixtures,@pytest.mark.tuimarker, and--tui-trace/--tui-cols/--tui-rows/--tui-timeoutCLI flags. - Raw-mode setup of the slave PTY's line discipline so input bytes
(notably DEL
\x7fand Ctrl-S\x13) pass through verbatim instead of being mangled by VERASE / IXON. - Example test suite for gode under
examples/gode/. - 84 self-tests (input encoders, screen model, emulator, end-to-end session against a hand-rolled fixture TUI, snapshot round-trip).