# io.github.libtmux.kotlin.Session

- **Module:** io.github.libtmux.kotlin
- **Package:** io.github.libtmux:libtmux-kotlin
- **Language:** Kotlin
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/f56392b5d9bc7f1f9c1631842333fb90f3d82d40/libtmux-kotlin/src/main/kotlin/io/github/libtmux/kotlin/Session.kt#L13
- **Page:** https://libtmux.org/en/kotlin/latest/reference/io-github-libtmux-kotlin-session/

```
public class Session
```

A tmux session and its captured windows and properties.

Holds the Java handle privately, so a member here always wins over a same-named catalog-generated
extension in `SessionOperations.kt`. [Companion] hosts the generated query field namespace
(`Session.name`, `Session.attached`, ...).

## Members

### Parent objects

- `server` (property)

### Collections and queries

- `windows` (property): This session's windows, in tmux's order. A pure read of the capture.

### Common operations

- `newWindow` (method): Creates a window in this session and returns that exact window.
- `environment` (method): This session's own environment, which a process started in it is given on top of the server's.

### Other members

- `activePane` (property): The active pane of the active window. A pure read of the capture.
- `activeWindow` (property): The window tmux had active in this session. A pure read of the capture.
- `asJava` (property): The Java session this wraps: the same object, for a Java API that takes one.
- `attached` (property): Whether a client was attached when this was captured.
- `Companion` (module)
- `detachClients` (method): Detaches every client attached to this session, leaving the session running.
- `equals` (method)
- `expand` (method): Expands a tmux format in this session's context, and answers with what it came to.
- `hashCode` (method)
- `hooks` (method): This session's own hooks.
- `id` (property): The session's stable id.
- `kill` (method): Ends this session.
- `lastWindow` (method): Returns to the window that was active before this one.
- `name` (property): The session name, which a user may change at any time.
- `nextWindow` (method): Moves to the next window in this session, wrapping at the end.
- `options` (method): This session's own options.
- `previousWindow` (method): Moves to the previous window in this session, wrapping at the start.
- `refresh` (method): Takes a new capture and returns this session as it is now.
- `rename` (method): Renames this session and returns its replacement capture.
- `selectWindow` (method): Makes a window of this session the active one.
- `setHistoryLimit` (method): Sets the scrollback retained by panes created in this session.
- `toString` (method)
