Repository navigation
Conversation
why: Readers need the release notes for each public behavior in #193. what: - Preserve the breaking changes, examples and references from 48 PRs. - Describe nested coordinates, live bounds and frozen row extents. - Keep the existing release entries and the unreleased placeholder.
why: Readers need the release notes for each public behavior in #193. what: - Preserve the breaking changes, examples and references from 48 PRs. - Describe nested coordinates, live bounds and frozen row extents. - Keep the existing release entries and the unreleased placeholder.
6be85f1 to
1996c79
Compare
3d1963c to
4c0bf02
Compare
why: Readers need the release notes for each public behavior in #193. what: - Preserve the breaking changes, examples and references from 47 PRs. - Describe nested coordinates, live bounds and frozen row extents. - Keep the existing release entries and the unreleased placeholder.
Technical Assessment:
|
Dimension (master v0.0.1a5) |
Grade | Summary |
|---|---|---|
| Modern Python & Typing | A- | Python 3.12+, zero runtime deps, ty clean with 0 ignores / 2 casts / 7 Any, PEP 562 lazy root (4.6 ms import), PEP 695/688/678. |
| API Design & Ergonomics | B+ | Strong sans-I/O layering (Profile/Policy/Limits, Snapshot, SyncToken), undermined by leaky Screen internals, Terminal/Snapshot drift, and 163 private-attr accesses from contrib/tmux. |
| Implementation Quality | B | Real VT500/Unicode 17/RLE engineering (6.6–7.8 MiB/s ANSI, 1.9–3.4 MiB for 10k rows), held back by monolithic god-files, a 56.6× RowView.runs cliff, and several reproduced correctness/security bugs. |
| Documentation & Verification | B- | Zero buzzword fluff, 234 doctests, 766 official UAX #29 vectors; undermined by 20 broken Sphinx xrefs, unamended stale ADRs, narrow 3-trace Ghostty oracle (unrun in CI), and overstated benchmark claims. |
| Scope & Cohesion | C+ | 49.2% of src/libvt sits outside core VT emulation (including a 3,156-LOC Python port of tmux's C UI renderer and a 2,127-LOC bitmap-less graphics tracker). |
| Overall | ~8.0 / 10 | Best pure-Python VT architecture available; pre-alpha maturity and sprawl require pruning before 0.1/1.0. |
1. Evaluation of libvt (master)
API Design & Ergonomics
- What works well:
- Progressive disclosure: zero-setup
libvt.render()/libvt.strip()→Terminal→Parser+ zero-allocActionSink/Formatter/libvt.aio. - Clean separation of emulation quirks (
src/libvt/config.pyProfile), default-deny security gates (Policy), and DoS ceilings (Limits). - Zero-based
(row, col)coordinates everywhere, immutable tear-freeSnapshot/?2026committed, statelessSnapshot.viewport(offset), watermarkSyncToken/ScreenDelta, and cleanKeyEvent.parse("ctrl+c")insrc/libvt/input.py.
- Progressive disclosure: zero-setup
- Where it leaks or chafes:
- Public
Screenleaks_gridinternals: top-level re-exportedlibvt.Screenexposes raw 64-bit packed attribute words (bce_word: int = 0onscroll_up/scroll_down/push_scrollback_and_clear) and internal hooks (heal_before_edit,heal_wrapped_spacer_head,ensure_graphics) insrc/libvt/screen.py:1105-1410. - Unchecked mutators & missing sequence ergonomics:
Screen.cursor = Cursor(row=99, col=-5)(src/libvt/screen.py:1051-1060) is unvalidated and crashes the nextfeed()withIndexError;Screen/Snapshot/Terminalimplement__getitem__without__len__,__eq__, or__repr__(soiter(snap)works via legacy fallback whilelen(snap)throwsTypeError, andrepr(snap)prints a memory address);RegionViewlacks 2D slicing and value__eq__. - Core-to-
contriblayering inversion:src/libvt/testing.py:903unconditionally importslibvt.contrib.tmux.capture.TmuxCaptureResultat runtime, andcontrib/tmux/{capture,control}.pyreach into 163 private attributes/methods ofTerminal/Screen(including a dead-in-core backdoorTerminal._tabstops_from_listatsrc/libvt/terminal.py:2632-2634). - API surface drift:
Terminal.from_sizeomits 6 kwargs fromTerminal.__init__;pytest_plugin.pyTerminalFactoryomits 3;Terminal.program_statuses/imagesreturn mutabledicts whileSnapshotreturnsMappingProxyType;Screen.snapshot()defaultsactive_is_alt=Falseeven onscreens.alternate.
- Public
Implementation Quality & Measured Performance
- Genuine engineering strengths:
- Clean-room VT500 state machine in
src/libvt/parser.pywith regex-accelerated ground/CSI fast paths, ITU T.416 colon subparameter bitmasks, UTF-8/C1 isolation, and bounded buffers. - Two-tier storage in
src/libvt/_grid.py: lazyarray('Q')64-bit packed viewport rows (uniform-word fast path for unstyled lines) + RLEFrozenRowscrollback. Measuredtracemallocfor 10,000×80 rows:1.91 MiBplain /3.38 MiBstyled. - Bundled Unicode 17.0.0 two-stage UCD table (
src/libvt/_ucd.py) passing all 766 officialGraphemeBreakTest-17.0.0.txtvectors plus SHA-256 tamper verification. - Measured CPython 3.15 throughput (in-process):
Parser.feed_to=22.9 MiB/s,Terminal.feedASCII scroll =7.8 MiB/s,bench_vt.py80×24 truecolor frame =6.6 MiB/s(~0.35 ms/frame), styled ANSI scroll =2.7 MiB/s, CJK/ZWJ?2027=1.1 MiB/s.
- Clean-room VT500 state machine in
- Concrete bugs reproduced on
master:- Security/policy bypass:
src/libvt/terminal.py:6156checksnot cleaned.startswith("file://")case-sensitively, soOSC 9;9;FILE://evil.host/etc/passwdbypassesPolicy.osc7_hosts. - VT escape injection:
Formatter._render_vt(src/libvt/terminal.py:1354-1360) emits rawlink.uriandlink.idwithout sanitizing\x1b/\x07/;or honoringallow_unsafe_uris(a craftedHyperlinkinjects arbitrary terminal text on replay). - Tmux resync state leak:
_adopt_terminal_state(src/libvt/contrib/tmux/control.py:88-137) manually copies 43 ofTerminal's 77 attributes and misses 36, leaking guestOSC 10/11/4colors,OSC 7501status, title stacks, pendingOSC 99, and_repliesacross resyncs. - Other reproduced bugs:
vt_screen(t2, diff=vt_screen(t1))crashes withTypeErrordespite matching its type annotation (src/libvt/testing.py:1020);_extract_targetblindly calls.snapshot()on arbitrary objects inside nested containers (src/libvt/testing.py:917-925);AsyncTerminalStream.write_high_wateris dead code (src/libvt/aio.py:362);open_ptyleaks PTY FDs ifos.pipe()fails (src/libvt/aio.py:1860-1866); malformedOSC 7501permanently disablesOSC 9;4fallback (src/libvt/status.py:232);GraphicsTracker._next_auto_idstarts at0x8000_0001and silently overwrites Kitty imagei=2147483649(src/libvt/graphics.py:615);codec.explain()destroys colon SGR subparameters (src/libvt/codec.py:138);Screen._reflow_primarydrops trailing BCE backgrounds and inflatesevicted_totalon widen (src/libvt/screen.py:1554);ModeState.set_mode(Mode.DECTCEM)leaks visibility into?2026committed(src/libvt/terminal.py:3571).
- Security/policy bypass:
- Notable performance & structural flaws:
RowView.runsis 56.6× slower on_RowthanFrozenRow(1,002 msvs17.7 msfor 200×24×80 uniform screens) becausesrc/libvt/screen.py:482-526unpacks a fresh 12-fieldStyleper column with no uniform-attr or raw-word equality fast path.Terminalhas no__slots__despite 77 instance attributes and every other core class using__slots__.- God-file monoliths:
src/libvt/terminal.pyis 7,216 LOC (Terminalalone is 5,097 LOC, 110 members;_handle_csiis 699 LOC / CC=245,_handle_print423 LOC / CC=119,_handle_osc333 LOC / CC=118);src/libvt/contrib/tmux/window.pyis 3,156 LOC (composite_tmux_window662 LOC);src/libvt/screen.pyis 2,442 LOC (_reflow_primary332 LOC / CC=96) with a circular runtime import ofterminal.py.
Documentation & Verification
- Good: Zero marketing fluff; 234 doctests enforced by
tests/test_libvt.py:261-289; strongpyte 0.8.2migration guide (docs/topics/migrating-from-pyte.md); solid clean-room provenance policy. - Gaps:
- Docs CI omits Sphinx
-n, hiding 20 broken Python xrefs (including non-existentScreen.regionindocs/topics/testing.md:64and 17 renamed0.0.1a0symbols inCHANGES). docs/topics/architecture.md:17-18falsely claimsimport libvteagerly loads core modules (contradicting PEP 562__init__.py).- ADRs
0001–0010are all dated2026-11-21and unamended despite major rewrites (ADR 0002 specifies a closedEventunion and flatProfile; ADR 0001 claims10–35 MiB/swhich only holds for standaloneParser, notTerminal.feed; ADR 0003 claims400+fuzz trials vs actual130). - Ghostty differential testing (
tests/test_differential_ghostty.py) only covers 3 tiny hardcoded traces, never asserts styles/colors/scrollback, and always skips in CI. There is nohypothesisor raw-byte fuzzing.
- Docs CI omits Sphinx
Modern Python 3.12+ Idiomatics
Legitimately strong: zero runtime dependencies, py.typed, strict ty (error-on-warning = true, blanket-ignore-comment = "error"), 25+ Ruff rule groups, 16 PEP 695 type aliases, 39 collections.abc.Buffer signatures, StrEnum/IntFlag, frozen=True, slots=True dataclasses, PEP 562 lazy root (4.6 ms cold import vs 49 ms with Terminal), PEP 678 __notes__ on TerminalTimeoutError, and PyPy 3.12 + CPython 3.12–3.15 CI.
2. How PR #193 (experiment/integrated-vt) Improves or Worsens Posture
Context: PR #193 is a draft integration cohort (+15,022 / -1,956 across 69 files; CI green at 3d1963c, including macOS/Windows/PyPy) combining 48 open PRs: ~40 focused bugfix/polish PRs (#149–#192), 7 speculative [draft] Concept: PRs (#131, #133, #138–#142), and agent workflow policy (#155).
Net verdict on PR #193: It materially IMPROVES core VT/transport correctness, while materially WORSENING architectural discipline, scope bloat, and maintainability. Merging it wholesale would be a mistake; landing the underlying ~35–40 bugfix PRs individually while rejecting or redesigning the speculative Concept: PRs would be a clear net win.
How PR #193 IMPROVES Posture
- Real VT, parser, and input fixes:
- Completes parser state transitions before invoking external sink callbacks so exceptions don't corrupt parser state (
#175). - Adds
_byte_view()for strided/non-contiguousBufferinputs in parser/terminal/recorder (#186). - Fixes Kitty F3 (
CSI 13 ~vs cursor reply collision), special-key release gating (#176),"ctrl++"chord parsing (#187), and mutually exclusive mouse tracking vs coordinate encoding groups (#177). - Upgrades
Formatter._render_vtto preserveDECSCAprotection, scroll margins, active pen, and pending wrap (#180), and fixes HTML concealed-cell backgrounds (#178). - Adds first-class
unwrapped_textacrossScreen,Snapshot,Terminal,RegionView,Formatter, andrender(#152),Snapshot.find_cells() -> tuple[CellSpan, ...](#133), nestedRegionView[r, c]slicing +RowView.{used,text_used,full_row}+Snapshot.profile/Screen.profile(5d0be2b,#183), and fixes history wrap severing on viewport erase (#149).
- Completes parser state transitions before invoking external sink callbacks so exceptions don't corrupt parser state (
- Real
aio.pytransport hardening:- Shared foreground reader ownership (
#159),_FrameWaitsstepping through every?2026committed frame within a single read (#192),ECANCELEDon drain interrupted by close (#162), safe concurrentaclose()joining (#160),open_pty()FD-leak fix + Linuxpidfd/SCM_RIGHTSprocess-group teardown (#163), and reply-writer handoff (#168).
- Shared foreground reader ownership (
- Fixes several
testing.py/contribbugs frommaster:- Deletes the fragile
_absorb_2d_slackand scrollback-splicing heuristics intesting.py(#149)—a genuinely healthy simplification. - Fixes the
vt_screen(diff=vt_screen(...))crash (#191), moves_convert_nestedout of coretesting.pyintocontrib/syrupy.py(#151), removes thet.castviolation incontrib/tmux/control.py, and fixes shared control-client reply ownership (#161).
- Deletes the fragile
How PR #193 WORSENS Posture (Concrete Regressions, Seam Bugs & Bloat)
- Unreviewable integration lump & git hygiene: Squash commit
752ff4falone is +10,313 / -1,692 lines across 45 files, and commitf2b3980ships with authortemp-merge <temp@localhost>.src/libvtgrows from 29,897 → 33,598 LOC (src/libvt/terminal.pyhits 7,635 LOC). - Speculative, bolted-on
contrib/subprocess.py(+1,108 LOC across 3 files,#142):- Re-exports stdlib
Popen = subprocess.Popenandrun = subprocess.rununchanged in__all__(src/libvt/contrib/subprocess.py:22-23). - Invents a second, narrower process API (
VT,Capture,CompletedTerminal,open_terminal,run_terminal) that cannot passProfile,Policy,Limits,encoding, ortty_mode. - Spawns a dedicated
ThreadPoolExecutor(1)+asyncio.Runnerevent loop per child process and passestimeout=sys.float_info.maxintowait_for. - On macOS (
src/libvt/contrib/_darwin_pty.py), boots two nested Python interpreters per process (open_pty's-I -S -c _PTY_TRAMPOLINEexecs another-I -S -c _LEADERPython script that connects back over a temp Unix socket andPopens the command). - On Windows (
src/libvt/contrib/_conpty.py), hard-requiresReleasePseudoConsole(Windows 11 24H2 build 26100+), throwingNotImplementedErroron all Windows 10 and Win11 ≤23H2 hosts.
- Re-exports stdlib
- Monkey-patching duplicate replay engine (
src/libvt/_replay.py+src/libvt/pytest_plugin.py,#139):- Invents a second recording mechanism (
_ReplayCapture) alongsideFlightRecorder, then monkey-patches bound methods (term.feed = feed,term.feed_until = feed_until,term.resize = resize) directly onto liveTerminalinstances (src/libvt/pytest_plugin.py:82-84)—which permanently blocks adding__slots__toTerminal. - Hardcodes
scrollback=2_000invt_terminal(src/libvt/pytest_plugin.py:301).
- Invents a second recording mechanism (
- Verified integration seam bugs introduced inside PR Exercise pending terminal changes together on Linux #193 itself:
--vt-replay-dirbreaks PR Exercise pending terminal changes together on Linux #193's own strided-buffer fix (#186):src/libvt/pytest_plugin.py:69callsview.cast("B")directly instead of_byte_view(data), raisingTypeErroron non-contiguous buffers fed viafeed_until(). Sibling sitessrc/libvt/aio.py:1728andsrc/libvt/contrib/tmux/control.py:181,568also still call raw.cast("B").--vt-replay-dirbreaks PR Exercise pending terminal changes together on Linux #193's ownencoding="latin-1"fixture addition (#164):vt_factoryandvt_pty(src/libvt/pytest_plugin.py:355-360, 447-451) omitencoding == "utf-8"fromsupported=, while_replay.py:_play()hardcodes UTF-8—producing false mismatch failures on Latin-1 terminals.- Conflicting
raw_limitcontract:src/libvt/contrib/subprocess.py:81enforcesraw_limit >= 64even though#182in the same PR removedFlightRecorder's 64-byte floor as a breaking change. - Inconsistent exceptions on adjacent methods: On
TmuxPaneSync(src/libvt/contrib/tmux/control.py),begin_attach()raisesProtocolErrorfortmux < 3.2(L971, with a redundant local import ofProtocolErrorat L963 already imported at L14), whilewatch_process()40 lines below raisesValueErrorfor the exact same< (3, 2)check (L1019). - Factual falsehood & broken PyPI links in
README.md:README.md:130-133on the PR branch still claimsvt_screen"absorb[s] regex scrubber width changes inside│borders" even though#149deleted_absorb_2d_slack(the doctest passed only by coincidence becauselen("pid=48210") == len("pid=<PID>") == 9). PR Exercise pending terminal changes together on Linux #193 also inserts 6 relative repo links (docs/topics/...,tests/test_fzf_cookbook.py,examples/tmux_screens.py) intoREADME.md—breaking PyPI's rendered description (examples/isn't even packaged in the sdist).
- Over-engineered snapshot wire formats (
#151):src/libvt/testing.pyappends JSONcolumns: {"0":[...]}footers to boxed frames, andsrc/libvt/contrib/syrupy.pyadds ~180 lines of bespoke multi-section framing (libvt snapshot sections 1+ JSON path/height headers +<VT screen>placeholders), turning human-readable.ambrsnapshots into a complex custom serialization format.
- Unfixed
masterdefects still present in PR Exercise pending terminal changes together on Linux #193:FILE://uppercase policy bypass (src/libvt/terminal.py:6549), unsanitizedOSC 8VT injection (src/libvt/terminal.py:1596-1597),_adopt_terminal_state36-field state leak, deadAsyncTerminalStream.write_high_water,testing.py's runtime import ofcontrib/tmux+ blind.snapshot()invocation,status.py:232,graphics.py:615,codec.py:138,control.py:755rstrip, andRowView.runs's 56.6× slowdown are all still unfixed.
3. Red Flags, Bloat & AI-Slop Assessment
To be fair: the core code is NOT generic AI slop. The VT500 transitions, packed 64-bit grid, UAX #29 tables, zero-type: ignore discipline, and crisp doc prose reflect serious engineering rigor.
The actual red flags and high-velocity bloat signatures are structural:
- Everything-bagel scope bloat:
src/libvt/contrib/tmux/window.py(3,156 LOC portingtmux's C theme/border/format compositor, parsing ~650 inline X11 color names at import time),src/libvt/graphics.py(2,127 LOC with 16,384-bit Pythonintmasks in a pixel-less emulator), niche RexOSC 7501woven through 7 core modules, and in PR Exercise pending terminal changes together on Linux #193:contrib/subprocess.py(+1,108 LOC), a 492-line text adventure (examples/last_beacon/),REVIEW.md, and.agents/skills/+.claude/skillssymlink checked into the library repo. - "Coverage-by-doctest" padding on private internals (violating
.github/WRITING.md):- 493 docstring lines on 26
_privatefunctions insrc/libvt/terminal.py(e.g.,_event_byte_cost: 25 doc lines citing PEP 557 for 3 lines of code;_bump_appearance: 11 doc lines for 2 lines of code). - 8 copy-pasted dummy writer classes inside
src/libvt/aio.pydocstrings, 14 doctested private helpers insrc/libvt/contrib/tmux/capture.py(_trim_unwrapped_row: 12 doc lines for a 1-line body), and tautological doctests (>>> MouseTracker() is not None -> True,>>> hasattr(PtySession, "_flush_terminal_replies") -> True). - Meanwhile, the genuinely hard algorithms have almost zero comments:
_reflow_primary(332 LOC, 0 comments),_handle_csi(699 LOC, 0 docstrings),src/libvt/screen.py(1 comment line in 2,442 LOC).
- 493 docstring lines on 26
- Hyper-velocity artifacts: Leaked scratchpad comments in
tests/test_pyte_compat.py:315,361(# ... = 5? Wait: cols=6 -> 'abcd日' fits!), a dead no-op assertion attests/test_pyte_compat.py:335(assert snap.screen_lines if hasattr(snap, "screen_lines") else True), kitchen-sink 200-line test functions, and a 1,174-line benchmark CLI (scripts/benchmark.py) that runsgit checkoutdirectly in the live working tree to drive 2 commands.
Bottom Line
- As a Python VT library: Strongly promising Core(feat[vt]): Add initial
Parser,Screen,Terminal,aio, andpytestlayout #1 pure-Python contender—worth adopting for terminal testing/emulation once it stabilizes, provided you don't need native C/Zig/Rust throughput. - On PR Exercise pending terminal changes together on Linux #193: Keep it strictly as a throwaway integration testbed. Land the ~35–40 core parser/VT/
aio/tmux/testing bugfix PRs individually; drop or rethinkcontrib/subprocess.py(#142), the monkey-patching_replay.py(#139), thelast_beacongame (#140), and the bespoke Syrupy multi-section framing (#151); splitterminal.pyand movecontrib/tmux/window.pytolibtmuxbefore cutting0.1.0.
|
I would keep this draft as an integration check and land changes through their source PRs. Three findings affect what can ship from
Erase performance belongs on #149. Its incoming-wrap correction checks predecessors repeatedly during a whole-display erase. On a pinned Linux CPU, the local candidate reduced 10,000 checks to 800 and raised median throughput from 3.65 to 4.85 MiB/s on that redraw stream. Keep #153’s history-boundary correction. #199 tracks the measured cost and controls. Other owners. #198 covers deletion of fields from a shared committed snapshot, present since #2. #200 documents working assertions and committed goldens during a held redraw (#2, #66, #67). #201 corrects the root-import guide (#47, #51). #142’s predicate timeout and subprocess-compatible exit/EOF timeout have different catch types and leave the handle usable on Linux. #106 records both catches and the native support boundary. One isolated run of untouched #193 also reproduced the #161 tmux fixture race. Waiting for the child’s first screen before starting the control requests passed all 48 repeat cases with mise-tmux 3.8. #202 tracks that test. #75 tracks reply ownership. For #12, both marked comparisons passed against a fresh, pinned Ghostty 1.0.2 build. That local result covers the two existing cases. #157 supplies the written-space comparison they need. These corrections are in local worktrees. The linked issues distinguish the published reproductions from the proposed fixes. The final local candidates passed 880 checkout tests and doctests, including the compiled Ghostty cases. The extracted sdist passed 878 and skipped two repository-only benchmark tests. The wheel contains Independent review recommends adopting the ten local source diffs as reviewed and requests changes on the published draft at |
4c0bf02 to
949994b
Compare
why: Readers need a first interactive test with an observable result. what: - Wait for a POSIX child to acknowledge a submitted line. - Exercise the example through README doctest collection.
why: A terminal can echo a keystroke before the child reads it. what: - Point readers to the README check for the child's response.
why: A mouse event needs a terminal column for a visible label. what: - Add CellSpan and Snapshot.find_cells in libvt.snapshot and re-export CellSpan from libvt.terminal - Return ordered row and column spans for complete graphemes - Cover wide cells, written spaces, overlaps, and a real mouse target - Document cell search in README.md and docs/topics/snapshots.md
why: Callers need the import location for matches returned by snapshot
search.
what:
- Map CellSpan to the public terminal APIs
why: A wide or combined character can put a label at a different column
from its string index.
what:
- Document CellSpan's row and half-open column range under 0.0.1a7
why: The visible highlight and the accepted record are independently observable results of a terminal interaction. what: - Test Enter and Escape against a real POSIX fzf process. - Include the tested source in the guide and link it from the README.
why: A highlighted candidate can still be cancelled before fzf writes a
record.
what:
- Describe both selection outcomes in the README link.
why: The recipe should control the geometry and temporary files of the
real picker.
what:
- Pass a private TMPDIR and an explicit viewport to fzf
- Skip only when the host cannot allocate a PTY
- Document the geometry and both outcomes in the recipe
why: Pressing Escape writes no selection, even if fzf highlighted a row. what: - Point to the recipe that checks the screen, output and exit status.
why: Relative links in README.md break when rendered on PyPI. what: - Point the fzf cookbook link at GitHub blob master.
why: Terminal failures need ordered byte spans, external resizes,
initial encoding, and exact cell diagnostics to reproduce
offline.
what:
- Attach a bounded TerminalRecorder capture via --vt-replay-dir
without monkey-patching slotted Terminal instances
- Preserve initial utf-8 and latin-1 encoding and verify replayed
frames, styles, cursor, wraps, and geometry in python -m libvt replay
- Report the first differing row, display column, and full glyph in
assert_screen using RowView and existing UCD cluster stepping
- Cover ordered resizes, strided buffers, DECCOLM, latin-1, POSIX PTY
replays, incomplete captures, and CLI validation
why: Readers need the failure-capture workflow, offline replay command,
and cell-difference behavior documented alongside the fixtures.
what:
- Add the replay guide and runnable example reference in testing docs
- Link the published replay section from README.md
- Record the replay feature and assertion diagnostic fix in CHANGES
why: A complete terminal interaction can prove that a child received input, adapted its layout, and rendered the expected style. what: - Include a solo text adventure and an executable POSIX tour. - Check child-observed geometry, snapshots, and a green victory. - Replay a bundled recording without launching a process.
why: Windows still supports reading transcripts and replaying a tour. what: - Restrict raw terminal configuration to the POSIX playback path.
why: Python -O skips assertions, so a corrupt recording or unexpected
exit could pass the walkthrough.
what:
- Validate saved checkpoints and process results under Python
optimization
- Keep the live game, transcript and replay instructions executable
why: The game gives readers a way to exercise a resize and reproduce the
resulting screen.
what:
- Point to the walkthrough for checking and replaying a winning run.
why: Terminal.recorder now types as the TerminalRecorder protocol, and relative README links break when rendered on PyPI. what: - Narrow player.terminal.recorder to FlightRecorder before reading byte bounds. - Point the README walkthrough link at libvt.git-pull.com.
why: A pane grid and the copy-mode viewport can show different rows, and a resize changes where a pane-local click lands. what: - Compare a selected ledger entry with the live application grid. - Recover mode rows from their scroll offset when supported. - Verify the child’s click coordinates and keyboard focus after resize.
why: The guide must display the same translation that the picker uses. what: - Render both coordinate calculations from the runnable example.
why: The mouse guest imports tty, which requires POSIX termios. what: - Gate the raw mouse reader on a supported platform.
why: The example must read the live client while commands run and verify
which pane received input.
what:
- Drain command pipes asynchronously and reap cancelled subprocesses
- Check observed copy-mode rows and the translated mouse receipt
- Exercise command cancellation and stale coordinates
why: A tmux client in copy mode can show a different screen from the
application in the pane.
what:
- Describe how the guide checks which pane receives a translated click.
why: Relative links in README.md break when rendered on PyPI. what: - Point the tmux screens guide link at libvt.git-pull.com. - Point the runnable example link at GitHub blob master.
why: Reuse terminal initialization, slave PTY configuration, and reader attachment between open_pty and the Darwin session-leader launcher without duplicating termios or OSC 7 setup. what: - Extract _resolve_python_executable, _make_pty_terminal, _prepare_pty_fds, and _child_pty_env in libvt.aio._pty. - Add PtySession._start_reading and call it from open_pty.
why: Synchronous tests need real PTY or ConPTY interaction, bounded output capture, and separate child-exit vs terminal-EOF waits on top of libvt's async sessions and recorder protocol. what: - Add libvt.contrib.subprocess with VT (raw_limit >= 0), Capture, CompletedTerminal, TerminalProcess, CalledTerminalError, TerminalTimeoutExpired, open_terminal, and run_terminal without re-exporting stdlib Popen or run. - Resolve FlightRecorder via find_flight_recorder and implement SupportsVtTarget on Capture and TerminalProcess. - Add a single-trampoline Darwin PTY session owner over socket.socketpair and a Win32 ConPTY backend. - Document libvt.contrib.subprocess in docs, README, and CHANGES, and add cross-platform subprocess and Darwin helper tests. Refs #106
949994b to
eaa0410
Compare
Summary
master(d087b05), which includesv0.0.1a6, the structural split in core(refactor): Split views, snapshot, dispatch, recorder, target, and aio (#203) #204 (Splitterminal.pyandscreen.py, decouplecontrib, restack PRs #203), and the per-module API reference pages and doc-coverage test in docs(api): Add per-module pages and split aio #205.This experimental branch gives maintainers a single revision to exercise the remaining open concept branches together. The individual source PRs remain the review units for their changes.
Source PRs
concept/interactive-readme07e6006README.mdconcept/snapshot-cell-search7763e7bSnapshot.find_cells()andCellSpandisplay-cell coordinatesconcept/fzf-cookbook618e28ffzfselection and cancellation cookbook and testconcept/pytest-replay8ef451dpytest --vt-replay-dirfailure capture,python -m libvt replay, and hidden diff reporting inassert_screen()concept/last-beacon98669dcconcept/tmux-which-screen17eea55concept/terminal-subprocess6776ee2libvt.contrib.subprocess(open_terminal(),run_terminal(), POSIX PTY and Windows ConPTY) anddocs/api/contrib/subprocess.mdWhere changes meet
libvt.contrib.subprocessexposesTerminalProcessandCompletedTerminal(Capture) throughSupportsVtTargetfrom #204 (#203), sovt_screen()andserialize_vt_snapshot()serialize synchronous child sessions alongsideSnapshot.find_cells()lookups from #133.pytest --vt-replay-dir(#139) records terminal feeds and external resizes throughTerminalRecorderwithout mutatingTerminalinternals and replays failures byte-by-byte throughpython -m libvt replay.docs/api/contrib/subprocess.md(#142) anddocs/api/terminal.md(#133) align with the per-module API split andtest_every_public_module_has_api_doc_page()check from #205.Local verification
ruff check .andruff format --check .pass.ty checkpasses for Linux 3.12, Linux 3.15, macOS 3.14, and Windows 3.14.import libvtleavesasyncio,pty,pytest, andlibvt.terminalunloaded;import libvt.pytest_pluginleaveslibvt.terminal,libvt._replay,libvt._ucd,asyncio, andptyunloaded.pytest -qsuite passes (1296 passed, 2 skipped), includingtests/test_libvt.py::test_every_public_module_has_api_doc_page,README.md, anddocs/doctests.sphinx-build -q -b dirhtml -W --keep-going docspasses with zero warnings.examples/last_beacon/tour.pypasses live and with--replay --chunk-size 1, and cross-PR interoperability passes across snapshot(feat): Locate text by cell coordinates #133, testing(feat[replay]): Replay failed pytest runs #139, and Concept: Drive terminal subprocesses from synchronous Python #142.