# tmux.Connection

- **Module:** tmux
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-go/blob/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/connection.go#L60
- **Page:** https://libtmux.org/reference/go/tmux-connection/

Connection owns terminal control-mode transport to the exact daemon that materialized its session. Values obtained from Server or Session retain the connection. Closing is terminal: they neither reconnect nor fall back to a subprocess. Its lanes are attached tmux clients; closing the last client can trigger tmux's destroy-unattached or exit-unattached policy. On tmux 3.6 or later, destroying its initial session moves the clients to another session when one exists; the retained Session value keeps its original identity.

## Members

- `Server` (method) — Server returns the ordinary server value bound to this connection.
- `Session` (method) — Session returns the attached session value bound to this connection.
- `Lanes` (method) — Lanes reports the number of owned control-mode command lanes.
- `Call` (method) — Call executes one safely encoded tmux command on an owned lane and returns every reply frame in order. An alias may produce zero or multiple frames; a %error frame remains result data through [ControlCommandResult.Failed]. Args always describe one command, so a bare semicolon is quoted as an operand rather than interpreted as a command-list separator.
- `CloseContext` (method) — CloseContext starts terminal shutdown and waits within ctx. The context bounds only the wait; a later call may resume waiting for the same shutdown.
- `Close` (method) — Close terminally closes every lane on bounded internal contexts. It is safe to call concurrently and more than once.
