# session.Session

- **Module:** session
- **Package:** @libtmux/libtmux
- **Language:** TypeScript
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-ts/blob/2cb93308200da38a26b59876618116850f110607/packages/libtmux/src/session.ts#L50
- **Page:** https://libtmux.org/reference/ts/session-session/

## Members

- `sessionBrand` (attribute)
- `server` (attribute) — The server this handle addresses.
- `constructor` (method)
- `windows` (method) — Windows placed in this session, in listing order.
- `panes` (method) — Panes contained by this session's windows.
- `showOptions` (method) — Every option set on this session itself, not the ones it inherits.
- `showResolvedOptions` (method) — The option values that govern this session, own and inherited together.
- `setOption` (method) — Set an option on this session.
- `unsetOption` (method) — Remove an option from this session.
- `showHooks` (method) — Every hook this session reports.
- `setHook` (method) — Bind a tmux command to a hook on this session.
- `unsetHook` (method) — Remove a hook from this session.
- `showEnvironment` (method) — Every variable in this session's environment.
- `getEnvironment` (method) — One variable from this session's environment, or `undefined` when tmux carries no entry.
- `setEnvironment` (method) — Set a variable in this session's environment.
- `unsetEnvironment` (method) — Drop a variable from this session's environment entirely.
- `removeEnvironment` (method) — Mark a variable in this session's environment for removal from the environment of processes tmux starts, leaving the entry in place.
- `activeWindow` (method) — The window tmux marks active in this session.
- `activePane` (method) — The pane tmux marks active in this session's active window.
- `newWindow` (method) — Create a window in this session and resolve it as a handle.
- `plan` (method) — The same mutations, described instead of run.
- `kill` (method) — Destroy this session.
- `refreshed` (method) — This session, read again at a new instant.
- `rename` (method) — Rename this session.
- `selectWindow` (method) — Select the last, next, or previous window, or one named by target.
- `fromEnv` (method) — Resolve the session this process is running inside.
- `detach` (method) — Detach every client attached to this session.
- `cmd` (method) — Run a tmux command this package does not model, addressed at this session.
- `equals` (method) — Whether `other` is this same session on this same server.
- `sameTmuxIdAs` (method) — Whether `other` carries the same `$n`, wherever it came from.
- `toString` (method) — How this handle renders in a log line, a template literal, or an error.
- `format` (property) — The raw tmux format row, addressed by tmux's own token names.
