LibTmux.Mcp.PaneActivityHub
.NET
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java Unavailable
- .NET
- C++ Unavailable
- Swift Unavailable
-
Tells a waiter the moment a pane prints something.
tmux will report pane output as it happens to a client in control mode, so a wait can sleep until there is something to look at instead of asking every few milliseconds whether anything changed. On a wait that ends up timing out, that is the difference between hundreds of tmux processes and none.
What arrives on that stream is the pane's raw terminal bytes — escape sequences, redraws and all — which is why it is used as a signal and never as content. The text a caller gets always comes from a capture, which is what tmux has already rendered.
A control client sees only the session it attached to, so watches are per session and reference counted. Control mode is an optimisation, not a requirement: when a client cannot start, waiting falls back to polling and the caller cannot tell the difference except in cost.
Members
-
Initializes the hub.
- Parameters
-
-
logger ( ILogger? ) – Records why a control client could not start.
-
-
Gets whether any session is currently watched through control mode.
-
Reports whether this process opened the named control client.
tmux counts an observation client the same way it counts a human one, so a client listing that wants to answer "is anyone actually watching" excludes every name this method reports as owned.
- Parameters
-
-
clientName ( string ) – A client name, such as tmux reports for
#{client_name}.
-
- Returns
-
truewhen this hub started that client.
- WatchAsync ( pane : Pane , cancellationToken : CancellationToken ) Task<IAsyncDisposable>
-
Watches a pane's session for as long as the result is held.
Take one of these around a wait. Without it the wait still works, by polling; with it, tmux does the waiting.
- Parameters
-
-
pane ( Pane ) – The pane whose session to watch.
-
cancellationToken ( CancellationToken ) – Cancels starting the control client.
-
- Returns
-
A lease that stops watching when disposed.
-
Waits until a pane prints something, or the time runs out.
- Parameters
-
-
paneId ( string ) – The pane to wait on.
-
signalBefore ( object? ) – The signal captured before the caller last read the pane. Passing the one taken before the read is what stops output that arrived during it from being missed.
-
timeout ( TimeSpan ) – How long to wait at most.
-
cancellationToken ( CancellationToken ) – Stops waiting.
-
- Returns
-
truewhen the pane printed something.
-
-
Takes the token that a later wait on this pane will wake from.
Take this <em>before</em> reading the pane. Output that arrives between the read and the wait would otherwise leave the waiter asleep with the answer already on screen.
- Parameters
-
-
pane ( Pane ) – The pane about to be read.
-
- Returns
-
The token, or null when that pane's session is not streaming.