# LibTmux.Server

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Server.cs#L9
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-server/

Represents an immutable server handle and snapshot.

Thread-safe: the handle is immutable once constructed and may be shared
freely, including as a singleton. Every mutating call answers a new handle
rather than changing this one.

## Members

- `SearchSessionsAsync` (method): Runs a tmux-side filter over every session.
- `SearchWindowsAsync` (method): Runs a tmux-side filter over every window.
- `SearchPanesAsync` (method): Runs a tmux-side filter over every pane.
- `ConfigureAccessAsync` (method): Grants or withdraws another user's access to this server.
- `SourceFileAsync` (method): Reads a tmux configuration file.
- `LockAsync` (method): Locks every client attached to this server.
- `GetMessagesAsync` (method): Reads what the server has been logging.
- `GetCommandsAsync` (method): Reads the commands this tmux knows.
- `Chain` (method): Begins a chain that runs its commands in one tmux invocation.
- `GetClientsAsync` (method): Reads the clients attached to this server.
- `DetachClientAsync` (method): Detaches one client.
- `DetachAllClientsAsync` (method): Detaches every client except one.
- `LockClientAsync` (method): Locks one client.
- `SuspendClientAsync` (method): Suspends one client.
- `RefreshClientAsync` (method): Redraws one client.
- `SwitchClientAsync` (method): Switches the caller's client to another session.
- `GetSessionsAsync` (method): Reads every session on this server.
- `GetAttachedSessionsAsync` (method): Reads every session with at least one attached client.
- `GetWindowsAsync` (method): Reads every window on this server.
- `GetPanesAsync` (method): Reads every pane on this server.
- `ExecuteCommandAsync` (method): Executes one raw tmux command.
- `EnterControlModeAsync` (method): Starts a tmux control client and keeps it running.
- `DisplayMessageAsync` (method): Shows a message on a client.
- `RunShellAsync` (method): Runs a shell command and reports what it printed.
- `IfShellAsync` (method): Runs one tmux command or another depending on a shell command.
- `WaitForAsync` (method): Waits on, signals, locks, or unlocks a tmux channel.
- `OpenWaitChannel` (method): Opens a wait on a channel that survives a timed attempt.
- `FromEnvironment` (method): Returns the server whose pane this process was spawned in.
- `ConnectionOptions` (property): Gets the connection options.
- `Generation` (property): Gets the materialized server generation.
- `IsMaterialized` (property): Gets whether this handle has discovered a live server.
- `Open` (method): Opens an unmaterialized server connection handle.
- `ConnectAsync` (method): Connects to a configured tmux endpoint.
- `GetSessionAsync` (method): Reads one session by identifier, throwing when it is absent.
- `FindSessionAsync` (method): Reads one session by identifier, returning null when it is absent.
- `GetWindowAsync` (method): Reads one window by identifier, throwing when it is absent.
- `FindWindowAsync` (method): Reads one window by identifier, returning null when it is absent.
- `GetPaneAsync` (method): Reads one pane by identifier, throwing when it is absent.
- `FindPaneAsync` (method): Reads one pane by identifier, returning null when it is absent.
- `Equals` (method)
- `GetHashCode` (method)
- `ShowCommandPromptAsync` (method): Asks a client for input and runs a command with the answer.
- `ClearPromptHistoryAsync` (method): Forgets what has been typed at command prompts.
- `GetPromptHistoryAsync` (method): Reads what has been typed at command prompts.
- `ConfirmBeforeAsync` (method): Asks a client to confirm before running a command.
- `ShowMenuAsync` (method): Shows a menu on a client.
- `StartServerAsync` (method): Starts the tmux server without creating a session.
- `IsAliveAsync` (method): Reports whether a tmux server is answering.
- `ThrowIfDeadAsync` (method): Throws unless a tmux server is answering.
- `KillAsync` (method): Stops the tmux server.
- `KillSessionAsync` (method): Stops one session.
- `HasSessionAsync` (method): Reports whether a session exists.
- `CreateSessionAsync` (method): Creates a session.
- `CreateOwnedAsync` (method): Starts a server and takes ownership of it.
- `CreateOwnedSessionAsync` (method): Creates a session and takes ownership of it.
- `AttachSessionAsync` (method): Attaches a client to a session on this server.
- `Options` (property): Gets the options of this server.
- `Hooks` (property): Gets the hooks of this server.
- `Buffers` (property): Gets the paste buffers of this server.
- `Keys` (property): Gets the key bindings of this server.
- `Environment` (property): Gets the environment new sessions inherit from.
- `Sessions` (property): Gets the sessions this handle captured.
- `Windows` (property): Gets the windows this handle captured, across every session.
- `Panes` (property): Gets the panes this handle captured, across every window.
- `Clients` (property): Gets the clients this handle captured.
- `CaptureSnapshotAsync` (method): Reads the server and answers a handle carrying what it found.
- `Version` (property): Gets the captured tmux version.
