# Session

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-swift/blob/f02a4668570e1cc5198c941413750e021f42c214/Sources/LibTmux/Session.swift#L4
- **Page:** https://libtmux.org/reference/swift/session/

A tmux session, as it was when the listing was read.

This is a value, not a live handle: nothing here re-reads tmux, and two
copies never disagree. Ask the server again for a newer view.

## Members

- `filterFieldType(_:)` (method) — The value kind an id names, or `nil` when this model does not know it.
- `filterFieldID(for:)` (method) — The stable wire id for a key path, or `nil` if the property is not filterable.
- `filterValue(_:of:)` (method) — Reads the field an id names, or `nil` if this model has no such field.
- `!=(_:_:)` (function) — Returns a Boolean value indicating whether two values are not equal.
- `id` (property) — tmux's own session id, stable for the session's lifetime — `$0`, `$1`. Names are not: a session can be renamed, and two servers can both have a `0`.
- `incarnation` (property) — The daemon this value was read from.
- `name` (property) — What a person calls it, and what tmux matches when a command names a session. Renameable, so it is not an identity.
- `windowCount` (property) — tmux's own count, so a caller needing only the number does not have to list the windows to get it.
- `isAttached` (property) — Whether any client is looking at this session. Opening a connection attaches one, so this reads differently from inside ``Server/connected(attachingTo:_:)`` — see <doc:Modes>.
- `createdAt` (property) — When tmux created the session, in seconds since the epoch. tmux's clock, not this process's.
- `init(id:name:windowCount:isAttached:createdAt:incarnation:)` (method)
- `init(from:)` (method) — Creates a new instance by decoding from the given decoder.
