# LibTmux.Session

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Session.cs#L4
- **Page:** https://libtmux.org/reference/dotnet/libtmux-session/

Represents an immutable session handle and snapshot.

## Members

- `Session` (method)
- `ExecuteCommandAsync` (method) — Executes one raw tmux command against this session.
- `FromEnvironmentAsync` (method) — Returns the session holding the pane this process runs in.
- `Snapshot` (property) — Gets the tmux fields captured when this handle materialized, or null when none were.
- `RawFormatFields` (property) — Gets the tmux fields captured when this handle materialized.
- `Id` (property) — Gets the session identifier.
- `Generation` (property) — Gets the server generation captured with this session.
- `Equals` (method)
- `GetHashCode` (method)
- `Name` (property) — Gets the session name captured with this handle.
- `Attached` (property) — Gets whether a client was attached when this session was read.
- `Server` (property) — Gets the server that owns this session.
- `RefreshAsync` (method) — Re-reads this session from tmux.
- `RenameAsync` (method) — Renames this session.
- `KillAsync` (method) — Stops this session.
- `LockAsync` (method) — Locks this session.
- `DetachClientAsync` (method) — Detaches every client attached to this session.
- `SelectWindowAsync` (method) — Selects a window in this session.
- `SelectNextWindowAsync` (method) — Selects the next window.
- `SelectPreviousWindowAsync` (method) — Selects the previous window.
- `KillWindowAsync` (method) — Stops one window in this session.
- `SwitchClientAsync` (method) — Switches the current client to this session.
- `SearchWindowsAsync` (method) — Runs a tmux-side filter over this session's windows.
- `SearchPanesAsync` (method) — Runs a tmux-side filter over this session's panes.
- `AttachAsync` (method) — Attaches a client to this session.
- `CreateWindowAsync` (method) — Creates a window in this session.
- `BuildAttachArguments` (method)
- `BuildNewWindowArguments` (method)
- `ActiveWindow` (property) — Gets the active window recorded when this session was read.
- `ActivePane` (property) — Gets the active pane recorded when this session was read.
- `Windows` (property) — Gets the windows the capture found in this session.
- `Panes` (property) — Gets the panes the capture found in this session.
- `GetWindowAsync` (method) — Reads one of this session's windows by target.
- `GetWindowsAsync` (method) — Reads this session's windows from tmux.
- `GetPanesAsync` (method) — Reads this session's panes from tmux.
- `WithCaptured` (method)
- `Options` (property) — Gets the options of this session.
- `Hooks` (property) — Gets the hooks of this session.
- `Environment` (property) — Gets the environment panes created in this session inherit from.
- `SelectLastWindowAsync` (method) — Selects the window that was last active.
- `CreateOwnedWindowAsync` (method) — Creates a window in this session and takes ownership of it.
