Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

LibTmux.Mcp.PaneActivityHub

.NET
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET
  • C++ Unavailable
  • Swift Unavailable

API reference · Markdown

class LibTmux.Mcp.PaneActivityHub
class [source]
class [source]
class LibTmux.Mcp.PaneActivityHub

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

PaneActivityHub

PaneActivityHub ( logger : ILogger? )
method [source]
method [source]
PaneActivityHub

Initializes the hub.

Parameters
  • logger ( ILogger? ) – Records why a control client could not start.

IsStreaming

IsStreaming : bool
property [source]
property [source]
IsStreaming

Gets whether any session is currently watched through control mode.

OwnsControlClient

OwnsControlClient ( clientName : string ) → bool
method [source]
method [source]
OwnsControlClient

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

true when this hub started that client.

DisposeAsync

DisposeAsync ( ) → ValueTask ( ) → ValueTask
methodasyncoverload2 overloads [source]
methodasyncoverload2 overloads [source]
DisposeAsync

WatchAsync

WatchAsync ( pane : Pane , cancellationToken : CancellationToken ) → Task<IAsyncDisposable>
methodasync [source]
methodasync [source]
WatchAsync

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.

WaitForActivityAsync

WaitForActivityAsync ( paneId : string , signalBefore : object? , timeout : TimeSpan , cancellationToken : CancellationToken ) → Task<bool>
methodasync [source]
methodasync [source]
WaitForActivityAsync

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

true when the pane printed something.

CaptureSignal

CaptureSignal ( paneId : string ) → object? ( pane : Pane ) → object?
methodoverload2 overloads [source]
methodoverload2 overloads [source]
CaptureSignal

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.

Esc

Type to search.