Skip to content

Window(feat[vt]): Add multi-pane window VT capture - #939

Open
tony wants to merge 8 commits into
feat-933-vtfrom
feat-933-vt-window
Open

tony wants to merge 8 commits into
feat-933-vtfrom
feat-933-vt-window

Conversation

@tony

@tony tony commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add Window.capture_vt() and capture_window_vt() to composite split windows into a Snapshot.
  • Add VtSessionObserver.snapshot_window() to composite live watched panes over control mode.
  • Add assert_window_screen() and assert_window_screen_box() for multi-pane layout and cursor checks.
  • Point [tool.uv.sources] for libvt at tmux-python/libvt#137 ahead of the next alpha.

Companion PR

Changes

  • src/libtmux/vt.py, src/libtmux/window.py: add capture_window_vt, Window.capture_vt, VtSessionObserver.snapshot_window, assert_window_screen, and assert_window_screen_box.
  • tests/test_vt.py: add split-pane, pane-border-status, zoom, error, and control-mode observer parity tests.
  • docs/api/libtmux.vt.md, CHANGES: add a tested 3-pane split window doctest and changelog notes.
  • pyproject.toml, uv.lock: point libvt in [tool.uv.sources] at tmux-python/libvt#137 while keeping the Python 3.12+ marker intact.

Test plan

  • Formatting and lint checks pass via uv run ruff format . .github/scripts --check and uv run ruff check . .github/scripts
  • Static type checks pass on Python 3.11 and Python 3.15 via uv run ty check and uv run ty check --python-version 3.15
  • Split-pane capture, border status, zoom, doctests, and observer parity pass via uv run pytest tests/test_vt.py src/libtmux/vt.py src/libtmux/window.py docs/api/libtmux.vt.md --reruns=0
  • Documentation site builds cleanly via just html
  • Full tmux 3.3a to master matrix in CI

tony added 3 commits November 30, 2026 19:07
why: Exercise libvt multi-pane window capture and compositing before the
next libvt alpha release is cut.

what:
- Point [tool.uv.sources] for libvt at tmux-python/libvt#137 and refresh
  uv.lock while keeping the Python 3.12+ extra marker intact
why: Let callers capture split tmux windows into a single composited
Snapshot with dividers, junctions, border status labels, and cursor
coordinates, or composite watched panes over a live tmux -C observer.

what:
- Add capture_window_vt, Window.capture_vt, assert_window_screen, and
  assert_window_screen_box
- Add VtSessionObserver.snapshot_window over control mode
- Add split-pane, border-status, zoom, error, and observer parity tests
why: Show tested multi-pane Snapshot grids in the VT guide and record
window capture in the changelog.

what:
- Add a 3-pane split window doctest to docs/api/libtmux.vt.md
- Update CHANGES for Window.capture_vt and snapshot_window
@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.00%. Comparing base (f619e06) to head (6fc46db).

Files with missing lines Patch % Lines
src/libtmux/vt.py 82.43% 7 Missing and 6 partials ⚠️
src/libtmux/window.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           feat-933-vt     #939      +/-   ##
===============================================
+ Coverage        62.75%   63.00%   +0.25%     
===============================================
  Files               30       30              
  Lines             5654     5731      +77     
  Branches          1186     1202      +16     
===============================================
+ Hits              3548     3611      +63     
- Misses            1714     1722       +8     
- Partials           392      398       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: Sending enter to every pane lets tmux reap the window before
win.kill() runs under faster scheduling.

what:
- Call win.kill() directly in test_window_capture_vt_splits_border_status_zoom_and_errors
tony added a commit to tmux-python/tmuxp that referenced this pull request Dec 1, 2026
why: tmux < 3.6 assigns odd remainder rows in layout_spread_cell to the
bottom split pane whereas tmux >= 3.6 assigns them to the top pane; an
8-row window gives 3 + 3 interior rows with zero remainder across all
tmux versions.

what:
- Size the dashboard PTY to 35x8 and refresh .ambr snapshots
- Point [tool.uv.sources] at the latest tmux-python/libtmux#939 tip
tony added 4 commits November 30, 2026 20:16
why:
libvt #137 (c73745e) checks active-pane stability in WIN_POST, sizes
3.3a-3.5 border-status spans to wp.width - 4, and derives default parse
profiles from tmux_version.

what:
- Repin [tool.uv.sources] libvt to c73745e26f98df49b397761c88801d37b202996c
- Pass include_layout=True and forward profile directly in capture_window_vt
- Shorten pane 2 title to fit 3.3a-3.5 border-status width and test focus switches
why:
Advance [tool.uv.sources] libvt pin to ddcc6bd (_Row._heal_wide_boundary
written-space preservation).

what:
- Repin libvt to ddcc6bd5aac53e243ef226780d30134a9fae0851
- Refresh uv.lock
why:
Writing CSI 2 J before Window.split fills the initial full-width row
with tmux GRID_FLAG_CLEARED spaces, causing grid_reflow_split to wrap
cleared trailing cells and push row 0 into scrollback if python writes
before split-window shrinks the pane.

what:
Omit redundant CSI 2 J / CSI H prefixes on freshly spawned split-window
doctest and test commands so row cellused matches visible text width.
why:
libvt 0.0.1a5 is published on PyPI with Screen blitting and multi-pane
tmux window capture, so the temporary git [tool.uv.sources] override is
no longer needed.

what:
- Bump libvt extra requirement to >=0.0.1a5,<0.1
- Remove [tool.uv.sources] libvt git override
- Refresh uv.lock against PyPI libvt 0.0.1a5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant