Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #934 +/- ##
==========================================
+ Coverage 62.05% 62.84% +0.79%
==========================================
Files 29 30 +1
Lines 5091 5658 +567
Branches 1082 1181 +99
==========================================
+ Hits 3159 3556 +397
- Misses 1592 1715 +123
- Partials 340 387 +47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 29, 2026
tony
added a commit
that referenced
this pull request
Nov 29, 2026
why: WRITING.md places pull-request references in deliverable headings rather than repeating them at paragraph ends. what: - Remove duplicate trailing (#934) references in CHANGES
tony
force-pushed
the
feat-933-vt
branch
3 times, most recently
from
November 30, 2026 01:57
153747b to
f619e06
Compare
This was referenced Dec 1, 2026
tony
force-pushed
the
feat-933-vt
branch
2 times, most recently
from
December 5, 2026 18:41
1a6c4be to
13958b6
Compare
why: Plain-string capture-pane output drops cell geometry, SGR styles, cursor visibility, DEC private modes, and saved primary scrollback behind alternate-screen TUIs, while text-decoded control-mode pipes cannot safely carry split multi-byte UTF-8 %output streams. what: - Add the optional libtmux[vt] extra (libvt>=0.0.1a4,<0.1 on Python 3.12+) with lazy _require_libvt() loading and ty unresolved-import allowlisting so core libtmux and Python 3.11 stay dependency-free. - Add Pane.capture_vt() and capture_pane_vt() for single-batch pane reconstruction, plus assert_pane_screen() and assert_pane_screen_box(). - Add Session.observe_vt(), Pane.observe_vt(), VtSessionObserver, VtPaneHandle, and the vt_observer pytest fixture with FIFO command and handshake queueing, stderr draining, ?2026 tear-free wait_until() Snapshot predicates, stalled-hold expiry, and FlightRecorder timeout reports. - Add Pane.send_vt_input() and VtPaneHandle.send_input() with mode-aware key, mouse (?1006/?1016), focus, and bracketed-paste encoding and tmux 3.7/3.8 one-shot capability refusal gates. - Document libtmux.vt with synchronous capture and interactive TUI lifecycle doctest recipes.
why: libvt 0.0.1a6 is published on PyPI with marker-framed TmuxPaneSync batches, native layout-change recapture, OUT_OF_SCOPE detection, and updated boxed step diff formatting. what: - Bump libvt extra requirement to >=0.0.1a6,<0.1 and refresh uv.lock against PyPI libvt 0.0.1a6. - Update VtSessionObserver to route control events to every TmuxPaneSync, frame direct commands with reply markers, and handle OUT_OF_SCOPE and per-pane ProtocolError isolation without closing sibling panes. - Update the boxed step diff styles line in docs/api/libtmux.vt.md.
why: libvt 0.0.1a7 is published on PyPI. what: - Bump libvt extra requirement from >=0.0.1a6,<0.1 to >=0.0.1a7,<0.1 - Refresh uv.lock against PyPI libvt 0.0.1a7
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libtmux[vt]extra on Python 3.12+ without changing core runtime dependencies.Pane.capture_vt()for single-batch reconstruction of pane cells,SGRstyles, modes, and scrollback.Session.observe_vt()andPane.observe_vt()for multiplexed raw-bytetmux -Cpane synchronization with tear-free?2026wait_until()Snapshotpredicates andFlightRecordertimeout diagnostics.Pane.send_vt_input()andVtPaneHandle.send_input()for mode-aware keyboard, mouse (?1006and?1016), focus, and paste encoding, gated by tmux release capabilities for one-shot paste (3.7+) and focus (3.8+).vt_observerpytest fixture plusassert_pane_screen()andassert_pane_screen_box()test helpers.Closes #933 (parent: #932; companion: #937, tmux-python/tmuxp#1118). Plain-string pane capture drops cell geometry,
SGRattributes, cursor visibility, active DEC private modes, and primary scrollback saved behind alternate-screen TUIs, while text-decoded control-mode pipes cannot safely carry split multi-byte UTF-8%outputstreams.Changes
Packaging and lazy boundary
pyproject.tomlanduv.lock: declare the optionalvtextra (libvt>=0.0.1a6,<0.1; python_version >= '3.12'), allowlist unresolvedlibvtimports under[tool.ty.analysis]for Python 3.11 and core environments, excludelibvtfrom theuvrelease-age cooldown, and scopeBLE001tosrc/libtmux/vt.py's background reader task.src/libtmux/vt.py: defer importinglibvtinside_require_libvt()until call time, keepingimport libtmux,import libtmux.pytest_plugin, andimport libtmux.vtfree oflibvton Python 3.11+ installations.Atomic capture, live control-mode sync, and mode-aware input
src/libtmux/vt.py: implementcapture_pane_vt(),send_pane_vt_input()(preservingTerminal?1016pixel dimensions and refusing one-shotPasteEventbelow tmux 3.7 andFocusEventbelow tmux 3.8 withVersionTooLowwhen no live observer is supplied),VtPaneHandle(including a per-paneFlightRecorderring buffer),VtSessionObserver(drainingstderr, routing control events acrossTmuxPaneSyncstate machines, framing direct commands with reply markers, and isolatingOUT_OF_SCOPEand per-paneProtocolErrorfailures),observe_pane_vt(),assert_pane_screen(), andassert_pane_screen_box().src/libtmux/_internal/support/capabilities.pyandcapabilities.json: addbracket-paste-format(3.7) andpane-private-modes-format(3.8) one-shot refusal capabilities forPane.send_vt_input()andsend_pane_vt_input().src/libtmux/pane.py: exposePane.capture_vt(),Pane.observe_vt(), andPane.send_vt_input().src/libtmux/session.py: exposeSession.observe_vt().Testing, pytest plugin, and documentation
src/libtmux/pytest_plugin.py: addVtObserverFactoryand thevt_observerfixture.tests/test_vt.py,tests/test_capabilities.py, andtests/test_docs_capabilities.py: exercise lazy import guards,Pane.capture_vt(), multiplexedVtSessionObserverresizes, in-placeresync(), per-operation%errorattribution,?2026tear-freewait_until()Snapshotpredicates and stalled-hold expiry,FlightRecorderrecent_bytestimeout diagnostics, mode-awaresend-keys -Hinput, capability release gates and Sphinx cross-references, and boxed screen assertions against livetmuxservers.docs/api/libtmux.vt.md,docs/api/index.md,docs/api/testing/pytest-plugin/fixtures.md, andCHANGES: documentlibtmux.vt(including its provisional pre-0.1libvtstatus, synchronous capture examples, and an executable recipe for testing interactivetmuxapplications),vt_observer, and thelibtmux[vt]extra.Design decisions
bytesinVtSessionObserverviaasyncio.create_subprocess_execand feedTmuxControlParserdirectly, becauseControlModeopensstdoutwithtext=Truewhereastmux -C%outputsplits multi-byte UTF-8 codepoints across lines and escapes control bytes as octal\ooo.TmuxPaneSyncbatches and queueVtPaneHandle.send_input()commands FIFO onVtSessionObserverso concurrentwatch_pane(),resync(), andsend_input()calls share onetmux -Csubprocess with per-operation%begin/%end/%errorattribution,stderrdiagnostics, and isolated per-pane recovery.VtPaneHandle.wait_until()predicates againstTerminal.committed(Snapshot) and return that exactSnapshot(with automatic stalled-?2026hold expiry and per-paneFlightRecorderbyte disassembly on timeout) so predicates never observe or return torn mid-frame screens.VersionTooLowfromsend_pane_vt_input()whenterminal=Nonebelow tmux3.7(PasteEvent) or3.8(FocusEvent), because#{bracket_paste_flag}and#{pane_private_modes}are absent there.libvtbehind PEP 508 markers and_require_libvt()at call time to preserve Python 3.11 compatibility and zero mandatory dependencies for corelibtmux.Test plan
tests/test_vt.py::test_vt_packaging_lazy_import_and_runtime_guardsSGRcell styles, wide CJK graphemes, bounded scrollback, saved primary history behind?1049h, structuredlibtmux.commonlogging, and dead-pane error propagation intests/test_vt.py::test_pane_capture_vt_cells_styles_history_alt_screen_and_logging%layout-changewindow resize handling, and in-placeresync()epoch tracking intests/test_vt.py::test_vt_session_observer_multiplex_resize_resync_and_logging%errorattribution, unattached-handle cleanup,?2026tear-freewait_until()Snapshotpredicates, stalled-hold expiry, andFlightRecorderrecent_bytestimeout diagnostics intests/test_vt.py::test_vt_observer_error_attribution_and_cleanupDECCKMapplication cursor keys,?2004bracketed paste sanitization and framing, one-shotVersionTooLowcapability gates, and?1006/?1016mouse events intests/test_vt.py::test_send_vt_input_mode_aware_keys_paste_and_mousetests/test_capabilities.pyandtests/test_docs_capabilities.pyassert_pane_screen()andassert_pane_screen_box()pass and mismatch diagnostics intests/test_vt.py::test_assert_pane_screen_and_box_helpersANNlint rules, strict types (3.11and3.15), doctests, and Sphinx links withuv run ruff format . .github/scripts --check,uv run ruff check . .github/scripts,uv run ty check,uv run ty check --python-version 3.15,uv run pytest, andjust build-docs