# 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/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Session.java#L23
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-session-session/

One tmux session, as one capture saw it.

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.

{@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.
- `environment` (method): This session's own environment, which a process started in it is given on top of the server's.
- `hooks` (method): This session's own hooks.
- `setHistoryLimit` (method): Sets the scrollback retained by panes created in this session.
- `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 its replacement capture.
- `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)
