Skip to content

tmux(feat[control]): Add parser and pane sync (#27) - #57

Merged
tony merged 1 commit into
masterfrom
feat/tmux-control-sync
Nov 28, 2026
Merged

tony merged 1 commit into
masterfrom
feat/tmux-control-sync

Conversation

@tony

@tony tony commented Nov 28, 2026

Copy link
Copy Markdown
Member

Closes #27 (depends on #56)

Summary

Adds a byte-oriented tmux -C / -CC control-mode parser (TmuxControlParser) and sans-I/O two-phase pane-attachment state machine (TmuxPaneSync) to libvt.contrib.tmux.control.

What changed

  • libvt.contrib.tmux.control.TmuxControlParser: frame raw bytes lines (O(N) buffer cursor scan, DCS 1000p ESC P 1000p .. ST stripping, single-level %begin .. %end/%error guard state, max_line_bytes / max_block_bytes truncation with partial octal escape tail stripping) into typed TmuxControlEvent records (TmuxCommandBlock, TmuxOutput, TmuxExtendedOutput, TmuxPause, TmuxContinue, TmuxLayoutChange, TmuxSubscriptionChanged, TmuxExit, TmuxNotification) without premature UTF-8 decoding.
  • libvt.contrib.tmux.control.TmuxPaneSync: coordinate the non-pipelined refresh-client -A '%N:pause' + nonce display-message barrier followed by an atomic single-batch capture-pane + capture-pane -P -p -C + refresh-client -A '%N:continue' handoff (_tmux_quote single-quoting for % and :) into a live Terminal under TMUX_OBSERVER_POLICY.
  • libvt.contrib.tmux, tests/test_tmux.py (including live tmux -C subprocess handoff verification), tests/test_libvt.py, docs/, and CHANGES: lazy PEP 562 exports, tests, doctests, and documentation.

@tony
tony force-pushed the feat/osc-notifications branch from 9773411 to d4d03b3 Compare November 28, 2026 20:20
@tony
tony changed the base branch from feat/osc-notifications to master November 28, 2026 20:23
why: Streaming tmux -C / -CC control mode requires raw-byte framing so
split multi-byte UTF-8 pane output never corrupts into U+FFFD, paired
with a non-pipelined pause barrier and single-batch capture+continue
handoff to attach to live panes without dropping bytes.

what:
- Add byte-oriented TmuxControlParser and typed TmuxControlEvent records
  (TmuxCommandBlock, TmuxOutput, TmuxExtendedOutput, TmuxPause,
  TmuxContinue, TmuxLayoutChange, TmuxSubscriptionChanged, TmuxExit,
  TmuxNotification) in libvt.contrib.tmux.control
- Add sans-I/O TmuxPaneSync and TmuxAttachPhase implementing nonce-acked
  refresh-client -A '%N:pause' + atomic capture-pane / capture-pane -P
  -p -C / refresh-client -A '%N:continue' handoff
- Export lazily from libvt.contrib.tmux, document across Sphinx docs and
  CHANGES, and test including live tmux -C subprocess synchronization
@tony
tony force-pushed the feat/tmux-control-sync branch from 46d5c59 to 9911520 Compare November 28, 2026 20:23
@tony
tony merged commit 53f1783 into master Nov 28, 2026
9 checks passed
@tony
tony deleted the feat/tmux-control-sync branch November 28, 2026 20:39

This branch was successfully deployed

1 active deployment
docs — 99115200 Deployed Nov 28, 2026 by tony via build (3.14) #124
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.

Add byte-oriented TmuxControlParser and two-phase -CC PaneAttach

1 participant