# ControlSession

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/ControlSession.swift#L94
- **Page:** https://libtmux.org/reference/swift/controlsession/

A live control-mode connection.

Commands go in and numbered replies come back, so output belongs to the
command that produced it — the attribution a `;` list cannot give. Anything
the server volunteers meanwhile arrives on ``notifications``.

## Members

- `preconditionIsolated(_:file:line:)` (method) — Stops program execution if the current task is not executing on this actor's serial executor.
- `assertIsolated(_:file:line:)` (method) — Stops program execution if the current task is not executing on this actor's serial executor.
- `assumeIsolated(_:file:line:)` (method) — Assume that the current task is executing on this actor's serial executor, or stop program execution otherwise.
- `notifications` (property) — Everything the server volunteered: `%output`, `%window-add`, and the rest.
- `send(_:)` (method) — Sends a command and waits for the block tmux brackets its reply with.
- `watch(_:)` (method) — Registers a format subscription on this connection.
- `stopWatching(_:)` (method) — Removes the subscription registered under `name`.
- `changes(named:)` (method) — Every subscription change on this connection, optionally narrowed to one subscription's name.
