# tmux.Snapshot

- **Module:** tmux
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/snapshot.go#L92
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-snapshot/

Snapshot is an immutable, observational view of one tmux server. It is normally returned by [Server.Snapshot]. Its zero value has a zero [Version], a zero [Server], non-nil empty collection slices, and not-found point lookups. Accessors never query tmux; returned slices are newly allocated and their contained records are shallow copies.

## Members

- `MarshalJSON` (method): MarshalJSON encodes the snapshot's tmux version and the records it holds. A kind it listed encodes as an array, empty when tmux reported none; a kind it never listed is absent. Those are different answers, and one field cannot spell both, which is why the arrays are pointers here. Nothing decodes; see [Session.MarshalJSON].
- `Version` (method): Version returns the tmux version that selected this snapshot's format fields. The zero Snapshot returns a zero Version.
- `Server` (method): Server returns the configured handle that produced this snapshot. The zero Snapshot returns a zero Server.
- `Sessions` (method): Sessions returns a newly allocated shallow copy of materialized sessions. It never queries tmux.
- `Windows` (method): Windows returns a newly allocated shallow copy with one view per winlink. It never queries tmux.
- `Panes` (method): Panes returns a newly allocated shallow copy of pane views for every winlink. It never queries tmux.
- `Clients` (method): Clients returns a newly allocated shallow copy of materialized clients. It never queries tmux.
- `SessionsSeq` (method): SessionsSeq returns an iterator over materialized session values. It never queries tmux.
- `WindowsSeq` (method): WindowsSeq returns an iterator over materialized winlink values. It never queries tmux.
- `PanesSeq` (method): PanesSeq returns an iterator over materialized pane-view values. It never queries tmux.
- `ClientsSeq` (method): ClientsSeq returns an iterator over materialized client values. It never queries tmux.
- `SessionByID` (method): SessionByID returns the sole session view with id. It never queries tmux and returns a [SnapshotLookupError] matching [ErrNotFound] otherwise.
- `WindowByID` (method): WindowByID returns the sole winlink view with id. Linked sessions can make an ID ambiguous, so it can return a [SnapshotLookupError] matching [ErrSnapshotAmbiguous]. It never queries tmux.
- `WindowsByID` (method): WindowsByID returns newly allocated shallow copies of every winlink view with id. It never queries tmux.
- `PaneByID` (method): PaneByID returns the sole pane view with id. Linked-session views can make an ID ambiguous, so it can return a [SnapshotLookupError] matching [ErrSnapshotAmbiguous]. It never queries tmux.
- `PanesByID` (method): PanesByID returns newly allocated shallow copies of every pane view with id. It never queries tmux.
- `ClientByName` (method): ClientByName returns the sole client view with name. It never queries tmux and returns a [SnapshotLookupError] matching [ErrNotFound] or [ErrSnapshotAmbiguous] when cardinality is not one.
