Changelog

libvt 0.0.1a1 (Yet to be released)

Notes on the upcoming release will go here.

libvt 0.0.1a0 (2026-11-22)

Initial pre-alpha release of libvt: a pure-Python, zero-dependency virtual terminal emulator, streaming VT500 byte parser, mode-aware input encoder, asyncio POSIX PTY adapter, and pytest plugin.

What’s new

Sans-I/O terminal core, two-tier RLE grid, and Unicode 17 width (#2)

Terminal, Screen, and Snapshot emulate primary and ?1049 alternate screens with zero-based (row, col) coordinates, lazy 64-bit inline viewport attributes, run-length-encoded scrollback history, and primary-screen soft-wrap resize reflow. Top-level render(), strip(), and explain() helpers handle common rendering, stripping, and sequence disassembly tasks, backed by python -m libvt CLI subcommands.

Parser decodes incremental UTF-8, colon-delimited ITU T.416 SGR subparameters (4:3, 38:2::R:G:B, 58:5:idx), G0–G3 character-set designations (ESC ( 0 DEC Special Graphics, SO/SI, SS2/SS3), HPR/VPR (CSI a / CSI e), CBT/CHT, DECSCA/DECSED/DECSEL, CSI 3 J / CSI 22 J, and DCS tmux; passthrough framing while isolating UTF-8 0x9C and U+009B bytes from 8-bit C1 controls (with optional encoding="latin-1" 8-bit wire mode). SHA-256-pinned Unicode 17.0.0 two-stage tables drive East Asian width and DEC ?2027 UAX #29 grapheme clustering across ZWJ emoji, Regional Indicator flag pairs, Indic conjuncts, Hangul jamo, and VS15 / VS16 emoji variation sequences. See Architecture & Grid Storage for details.

Synchronized output stepping, Rex OSC 7501, and host queries (#2)

committed(), feed_until(), and expire_synchronized_output() provide lazy copy-on-write frame holds and generation-tagged timeout recovery for DEC mode ?2026 synchronized updates. Formatter exports snapshots to plain text, VT escape sequences, and span-coalesced HTML with URI scheme allowlisting.

ProgramStatusStore and ProgramStatus implement the Rex OSC 7501 Program Status specification, including hierarchical task identifiers, ancestor app inheritance, urgency ranking, base64 title/msg validation, profile- and policy-gated OSC 7501 ; ? capability replies, OSC 9;4 fallback, and lifecycle pruning alongside OSC 133 prompt zones, OSC 7 RFC 8089 working directory updates, OSC 52 clipboard writes, OSC 10/11 and OSC 110/111 dynamic colors, tmux ESC k window renames (WindowRenamed), DA1/DA2, DSR, DECRQM, DECRQSS, XTVERSION, XTGETTCAP, and ?2031/?996n color-scheme queries. Configuration splits cleanly across Profile (including versioned tmux() phantom-column and resize compatibility profiles), Policy, and Limits. See Protocols & Input Encoding for details.

Mode-aware input encoding, asyncio PTY bridge, and pytest plugin (#2)

KeyEvent, MouseEvent, FocusEvent, and PasteEvent encode outbound PTY bytes against active terminal modes, including per-screen Kitty CSI u keyboard stacks (>u, <u, =u, ?u), SGR and SGR-Pixel mouse tracking (?1006, ?1016), and fail-closed bracketed paste validation raising UnsafePasteError.

AsyncTerminalStream and open_pty() connect sans-I/O terminals to asyncio streams and controlling POSIX pseudo-terminals (TIOCSCTTY and tty_mode) without importing asyncio or pty on import libvt. The pytest11 plugin provides protocol-typed vt_terminal, vt_factory, vt_parser, vt_recorder, and vt_pty fixtures alongside assert_screen(), assert_screen_box(), TerminalTimeoutError stream diagnostics, and FlightRecorder ring buffers. See Synchronized Output & asyncio for details.

Incremental sync deltas, tmux capture reconstruction, and graphics (#13–#20)

sync_token() and changes_since() emit non-destructive multi-consumer ScreenDelta updates across both "committed" (?2026-held) and "working" views, paired with apply_lines(), apply_rows(), and O(1) copy-on-write history sequence views.

decode_tmux_capture(), TmuxPaneMetadata, and unescape_tmux_control_output() reconstruct live Terminal and Snapshot state from tmux capture-pane (handling bare SO/SI ACS borders, GRID_FLAG_TAB tabstops, -F / -J soft wraps, phantom-column pending_wrap, and -a saved primary screens). libvt.graphics tracks zero-dependency SIXEL and Kitty APC G image metadata (ImageMeta) and monotonic abs_row grid placements (ImagePlacement and occupies_abs()) resolved alongside PromptZone anchors via at_abs() and viewport_row(). TerminalTimeoutError attaches multi-line viewport and flight-recorder diagnostics via PEP 678 __notes__ while keeping str(exc) single-line.

Documentation

  • Add Architecture Decision Records 0001–0010 documenting clean-room provenance, sans-I/O layering, two-tier RLE storage, Unicode 17 clustering, protocol semantics, input safety, and asyncio/pytest boundaries in Architecture Decision Records (#2).