Skip to content

Move tmux into decoupled libvt.contrib.tmux submodules #39

Done

Description

@tony

Summary

Wave 2 boundary slice of #34 (gated on Wave 1 Profile capability groups): relocate src/libvt/tmux.py into src/libvt/contrib/tmux/ with decoupled profile, capture, and control submodules, remove Terminal.from_tmux_capture(), Snapshot.from_tmux_capture(), Profile.tmux(), TMUX_PROFILE, and TMUX_CAPTURE_POLICY from core, and enforce one-way import hygiene in tests/test_libvt.py.

Motivation

Proposal

  • Create src/libvt/contrib/__init__.py and src/libvt/contrib/tmux/ containing decoupled profile.py, capture.py, control.py, and a lazy PEP 562 __init__.py, removing src/libvt/tmux.py.
  • Enforce strict submodule decoupling via subprocess sys.modules tests: importing libvt.contrib.tmux.profile loads neither capture nor control; importing libvt.contrib.tmux.capture loads profile without control; and importing libvt.contrib.tmux.control loads neither capture nor profile.
  • Implement tmux_profile(*, version=..., sixel=..., clipboard=...) in src/libvt/contrib/tmux/profile.py strictly over Wave 1's Profile capability groups (XTGETTCAP, CSI ? u, and DECSTR silent; DECRQSS enabled; RIS in ?1049h preserving alternate_on and saved_grid; DA1 parameterized on SIXEL and set-clipboard).
  • Delete Snapshot.from_tmux_capture(), Terminal.from_tmux_capture(), Profile.tmux(), TMUX_PROFILE, and TMUX_CAPTURE_POLICY from src/libvt/terminal.py and src/libvt/config.py, keeping TmuxCaptureResult and decode_tmux_capture() as the capture entry points and asserting that zero core modules import libvt.contrib.*.

Alternatives

  • Keeping libvt.tmux at the package root or under libvt.mux: rejected because libvt.contrib.<peer> cleanly separates maintained external integrations from the VT emulation core without assuming every future peer is a terminal multiplexer.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions