# io.github.libtmux.Session.Session

- **Module:** io.github.libtmux.Session
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/Session.java#L22
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-session-session/

One tmux session, as one capture saw it.

<p>Identity is the server and the session id. A name is state: a user can rename a session at any
time, and a handle whose equality included the name would stop matching itself the moment they
did.

<p>{@link #windows()} reads the capture this handle came from and issues no command. To see newer
state, take a new capture.

## Members

- `Session` (method)
- `id` (method) — The session's stable id.
- `name` (method) — The session name, which a user may change at any time.
- `attached` (method) — Whether a client was attached when this was captured.
- `server` (method) — The server this session lives on.
- `snapshot` (method)
- `activeWindow` (method) — The window tmux had active in this session. A pure read of the capture.
- `activePane` (method) — The active pane of the active window. A pure read of the capture.
- `selectWindow` (method) — Makes a window of this session the active one.
- `nextWindow` (method) — Moves to the next window in this session, wrapping at the end.
- `previousWindow` (method) — Moves to the previous window in this session, wrapping at the start.
- `lastWindow` (method) — Returns to the window that was active before this one.
- `detachClients` (method) — Detaches every client attached to this session, leaving the session running.
- `options` (method) — This session's own options.
- `hooks` (method) — This session's own hooks.
- `windows` (method) — This session's windows, in tmux's order. A pure read of the capture.
- `newWindow` (method) — Creates a window in this session and returns that exact window.
- `expand` (method) — Expands a tmux format in this session's context, and answers with what it came to.
- `rename` (method) — Renames this session and returns a handle on it as it is now.
- `kill` (method) — Ends this session. Every window in it goes with it.
- `refresh` (method) — Takes a new capture and returns this session as it is now.
- `equals` (method)
- `hashCode` (method)
- `toString` (method)
