Repository navigation
Conversation
why: Live tmux pane observers and libtmux[vt] need complete pane state capture, bounded history limits, %layout-change resize tracking, and in-place resynchronization that preserves SyncToken watermarks. what: - Extend TMUX_METADATA_FORMAT and TmuxPaneMetadata with cursor_shape, cursor_blinking, keypad_flag, and modify_other_keys, exposed on TmuxCaptureResult - Add bounded history_lines (-S 0 / -S -N) and tmux >= 3.7 -F detection (including master and -<suffix> versions) across capture and sync - Resize live panes from V1 and V2 JSON %layout-change notifications and add in-place TmuxPaneSync.resync()
This branch was successfully 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.
Closes #60 (depends on #62)
Summary
TMUX_METADATA_FORMATandTmuxPaneMetadatawith cursor shape, blink, keypad, andmodifyOtherKeysstate.history_lines(-S 0and-S -N) andtmux >= 3.7-Fcapture.TmuxPaneSyncterminals from V1 and V2 JSON%layout-changenotifications.TmuxPaneSync.resync()for in-place re-synchronization while preservingSyncTokenwatermarks.Changes
Version detection and pane capture
src/libvt/contrib/tmux/profile.py: accept"master"(mapped to(3, 9)) and general-<suffix>build tags inparse_tmux_version().src/libvt/contrib/tmux/capture.py: extendTMUX_METADATA_FORMAT(31tab-separated fields) while retaining27-field parsing inTmuxPaneMetadata.from_format_line(), applycursor_shape,cursor_blinking,keypad_flag, andmodify_other_keysto decodedTerminalstate, reconcile_scrolled_total/_evicted_total/PromptZoneoffsets whenhistory_linesbounds scrollback, exposemetadataandpost_metadataonTmuxCaptureResult, and enablecapture-pane -Fontmux >= 3.7.Live control-mode sync
src/libvt/contrib/tmux/control.py: addhistory_linesandtmux_versiontoTmuxPaneSync, parse target pane dimensions from compact V1 layout strings (WxH,X,Y,id) and V2 JSON layout payloads (%layout-change) to resizesync.terminal, and addTmuxPaneSync.resync()(also triggered automatically on%pause/%continuerecovery) updatingsync.terminalin place while advancing its epoch.Tests and documentation
tests/test_tmux.py: cover31-field and legacy27-field metadata parsing,history_linesandtmux >= 3.7-Fcapture commands, V1 and V2%layout-changeresizes,resync()identity andScreenDelta.full_resyncepoch increments, and livetmux -Csubprocess capture/resize/resync parity.docs/topics/migrating-from-pyte.mdandCHANGES: linkTmuxPaneSync.resync()and record the#60changelog entry.Design decisions
sync.terminalin place duringTmuxPaneSync.resync()and increment_epochrather than swapping in a newTerminalinstance so caller references stay valid while heldSyncTokenvalues reportScreenDelta.full_resync=True.27-field metadata strings alongside31-fieldTMUX_METADATA_FORMATstrings inTmuxPaneMetadata.from_format_line()so callers supplying older format strings continue to parse.Test plan
31-field and27-field metadata decoding,history_lines, andtmux >= 3.7-Fcapture flags intests/test_tmux.py%layout-changeresizes and in-placeTmuxPaneSync.resync()epoch updates intests/test_tmux.pytmux -Csubprocess capture, resize, andresync()parity intests/test_tmux.pyruff format,ruff check,ty check,pytest, andjust build-docs