# io.github.libtmux.Server.Server.session

- **Module:** io.github.libtmux.Server.Server
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Server.java#L959
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-server-server-session/

```
io.github.libtmux.Server.Server.session(name: String) -> Optional<Session>
```

The session with this name, captured now.

One read, so the handle carries a capture the way {@link #sessions()} does. The name is
matched exactly; tmux would otherwise take a prefix, so asking for {@code build} could answer
with {@code build-cache}.

Empty means a successful capture did not contain that name. Capture failures throw.

## Raises

- `ServerNotRunningException`: if no daemon is running
- `LibTmuxException`: if the capture otherwise fails
