Core Library0.xAPI reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice

class libtmux-dotnet

ServerMirror

A live copy of one tmux server's sessions, windows, panes and clients, rebuilt whenever tmux announces a change.

Source and package
Qualified name
LibTmux.ServerMirror
Namespace
LibTmux
Package
LibTmux
Source
src/LibTmux/Snapshots/ServerMirror.cs
class LibTmux.ServerMirror

Description

A control client attached to an anchor session hears what tmux announces. Any announcement, or the loss of one, starts a fresh capture, never a patch of the last one, since an announcement says that something changed, not everything that did. Announcements that arrive during a capture collapse into one more, and a capture that finds nothing different publishes nothing; activity times, cursor positions and history sizes, which change with every keystroke, do not count as different. Each published view carries an epoch one above the last, counted by this mirror.

tmux announces only some changes to a client: not a pane's running command or working directory, and not a layout change in a session the client is not attached to. Give a refresh interval to see those within that long.

When the control client ends, the mirror finds the anchor session again by its ID and attaches through it; if the session has gone, the mirror ends with TmuxObjectNotFoundException, and if the server has, with the failure that said so. The client asks tmux for notifications only, not pane output, and does not affect window sizes.

Properties3

ServerMirror properties
NameTypeDescription
Current ServerMirrorView Gets the latest published view.
Failure Exception? Gets why the mirror ended, when something other than disposal ended it.
IsEnded bool Gets whether the mirror has stopped publishing, because it was disposed or its anchor has gone.

Members5 members

  • DisposeAsync Stops listening and detaches the control client; the last view stays readable.
  • OpenAsync Mirrors the server an anchor session belongs to.
  • WaitForNewerAsync Waits for a view newer than an epoch.
  • WaitUntilAsync Waits until a view satisfies a condition, testing the current view first.
  • WatchAsync Streams the current view and then each newer one, skipping any published while the reader was busy.
Esc
Search in

Type to search.

Reference previewOpen reference