Core LibraryAPI Reference

Choose documentation 3

latest

Current version

latest
English

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

method libtmux-dotnet latest

PaneObservation.WatchAsync

Namespace LibTmux.PaneObservation.WatchAsync LibTmux

Watches one pane's output until it ends.

View as Markdown

Source and package
Module
LibTmux
Declared in
PaneObservation
Package
LibTmux
Source
src/LibTmux/ControlMode/PaneObservation.cs
WatchAsync ( session : IControlModeSession , pane : Pane , cancellationToken : CancellationToken ) → IAsyncEnumerable<TmuxEvent> ( session : IControlModeSession , panes : IReadOnlyCollection<Pane> , cancellationToken : CancellationToken ) → IAsyncEnumerable<TmuxEvent>
methodstaticoverload2 overloads [source]

Description#

tmux discards output it has not yet sent to a control client once the pane's program exits, so the last lines of a program that exits at once may never arrive. Read final output with RunAsync , or capture a pane kept with remain-on-exit.

Parameters
  • session ( IControlModeSession ) – The control client to watch through.

  • pane ( Pane ) – The pane to watch. (for WatchAsync(session, pane, cancellationToken))

  • cancellationToken ( CancellationToken ) – Stops watching.

  • panes ( IReadOnlyCollection<Pane> ) – The panes to watch; at least one. (for WatchAsync(session, panes, cancellationToken))

Returns

The pane's own output, with TmuxPanePausedEvent and TmuxPaneContinuedEvent around output a slow reader missed, ending with TmuxExitEvent when the control client itself ended, or with TmuxPaneGoneEvent once the pane is confirmed gone. Loss reports require resynchronization; buffered output precedes pane termination for watermark-backed control sessions. The client remains borrowed. (for WatchAsync(session, pane, cancellationToken))

The panes' own output in the order tmux sent it, with TmuxPanePausedEvent and TmuxPaneContinuedEvent around output a slow reader missed. Each pane confirmed gone is reported by a TmuxPaneGoneEvent after the output buffered before it went, unless the client ends first; panes found gone together are reported in the order given. The stream ends once every pane is gone, or with TmuxExitEvent when the control client itself ended. The client remains borrowed. (for WatchAsync(session, panes, cancellationToken))

Raises
  • ArgumentException – When reading starts, the pane is in a session other than the one the client is attached to; tmux sends a control client output only from its own session. (for WatchAsync(session, pane, cancellationToken))

  • InvalidOperationException – While reading, the pane's window left the client's session, or the client moved to another session, so tmux sends none of its output any more. tmux announces no change when swap-window trades the window with another session's, so that move leaves the watch silent. (for WatchAsync(session, pane, cancellationToken))

  • NotSupportedException – A control session without an event watermark cannot establish which output was buffered before pane termination. Its watch fails when the pane is confirmed gone, without consuming another event. (for WatchAsync(session, pane, cancellationToken))

  • ArgumentException – panes is empty, or, when reading starts, a pane is in a session other than the one the client is attached to; tmux sends a control client output only from its own session. (for WatchAsync(session, panes, cancellationToken))

  • InvalidOperationException – While reading, a pane's window left the client's session, or the client moved to another session, so tmux sends none of its output any more. tmux announces no change when swap-window trades the window with another session's, so that move leaves the watch silent. (for WatchAsync(session, panes, cancellationToken))

  • NotSupportedException – A control session without an event watermark cannot establish which output was buffered before a pane ended. Its watch fails when a pane is confirmed gone, without consuming another event. (for WatchAsync(session, panes, cancellationToken))

Esc

Type to search.