Context
The Rust SDK surfaces a per-pane revision (and output sequence) — the monotonic counter that increments when a pane's content/lifecycle changes. It's the canonical "did the pane actually change?" signal, which is central to building reliable agentic waits without polling or diffing rendered text.
On the Python side, PaneSnapshot is currently text-only (parsed from capture-pane -p): no revision, no output sequence. So a consumer can't tell "new output arrived" apart from "same screen re-rendered" without diffing text, which is exactly the kind of ghost-text ambiguity revision is meant to remove (spinners, status-line refreshes, prompt repaints, cursor blink).
Feasibility (already verified)
This does not require the bincode daemon protocol. The rmux binary already exposes these as format variables, reachable from Python through the existing display-message path:
$ rmux display-message -t <session> -p '#{pane_id}|#{pane_revision}'
%0|2
#{pane_revision} (alias of #{pane_lifecycle_revision})
#{pane_output_sequence}
librmux already wraps display-message (incl. --json), so the plumbing is in place. Verified against rmux 0.6.1.
Proposal (open to your preferred shape)
Two non-exclusive options:
-
Lightweight accessors on Pane:
pane.revision() -> int # #{pane_revision}
pane.output_sequence() -> int # #{pane_output_sequence}
Minimal, additive, no change to PaneSnapshot.
-
Enrich PaneSnapshot with revision: populate a revision: int | None field when a snapshot is captured, bringing it closer to the Rust PaneSnapshot.
I'd lean toward (1) first (smallest surface, immediately useful for wait/idle detection), with (2) as a follow-up if you want full snapshot parity.
Out of scope (flagging explicitly)
The structured grid + cursor snapshot (the Rust daemon PaneSnapshot endpoint) is bincode-only with no CLI/JSON path today, so it's not reachable from librmux without a new binary-side command. That's a separate, larger ask on the rmux core — not part of this issue.
Offer
Happy to send a PR once you confirm the shape (accessor naming, int vs str return, PaneSnapshot field vs method). Same approach as #1 (additive, fake_rmux_json unit tests + real smoke).
Context
The Rust SDK surfaces a per-pane
revision(and output sequence) — the monotonic counter that increments when a pane's content/lifecycle changes. It's the canonical "did the pane actually change?" signal, which is central to building reliable agentic waits without polling or diffing rendered text.On the Python side,
PaneSnapshotis currently text-only (parsed fromcapture-pane -p): norevision, no output sequence. So a consumer can't tell "new output arrived" apart from "same screen re-rendered" without diffing text, which is exactly the kind of ghost-text ambiguityrevisionis meant to remove (spinners, status-line refreshes, prompt repaints, cursor blink).Feasibility (already verified)
This does not require the bincode daemon protocol. The
rmuxbinary already exposes these as format variables, reachable from Python through the existingdisplay-messagepath:#{pane_revision}(alias of#{pane_lifecycle_revision})#{pane_output_sequence}librmuxalready wrapsdisplay-message(incl.--json), so the plumbing is in place. Verified againstrmux 0.6.1.Proposal (open to your preferred shape)
Two non-exclusive options:
Lightweight accessors on
Pane:Minimal, additive, no change to
PaneSnapshot.Enrich
PaneSnapshotwithrevision: populate arevision: int | Nonefield when a snapshot is captured, bringing it closer to the RustPaneSnapshot.I'd lean toward (1) first (smallest surface, immediately useful for wait/idle detection), with (2) as a follow-up if you want full snapshot parity.
Out of scope (flagging explicitly)
The structured grid + cursor snapshot (the Rust daemon
PaneSnapshotendpoint) is bincode-only with no CLI/JSON path today, so it's not reachable fromlibrmuxwithout a new binary-side command. That's a separate, larger ask on thermuxcore — not part of this issue.Offer
Happy to send a PR once you confirm the shape (accessor naming,
intvsstrreturn,PaneSnapshotfield vs method). Same approach as #1 (additive,fake_rmux_jsonunit tests + real smoke).