# io.github.libtmux.SessionSpec.SessionSpec

- **Module:** io.github.libtmux.SessionSpec
- **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/SessionSpec.java#L27
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-sessionspec-sessionspec/

How a session should be made.

<p>The shape {@link SplitSpec} and {@link WindowSpec} use. tmux's {@code -A}, which attaches when
the name is taken, is deliberately absent: attaching needs a terminal, and it fails with
{@code open terminal failed} on every supported release when there is none. Asking
{@link Server#hasSession} first does the same job from a process that has no tty, which is where a
library usually runs.

<pre>{@code
Session build = server.newSession(s -> s.named("build").sized(new Dimensions(120, 40)));
}</pre>

## Members

- `builder` (method) — A builder holding tmux's own defaults: a detached session tmux names itself.
- `name` (method) — The session name, or empty to let tmux number it.
- `directory` (method) — Where the session's first pane starts, or empty to inherit.
- `environment` (method) — Variables set for the new session, in the order they were given.
- `detached` (method) — Always true, and not a choice.
- `windowName` (method) — The name of the session's first window, or empty for tmux's choice.
- `size` (method) — How big the session is, or empty for tmux's default. Requires tmux 3.3a.
- `withoutSize` (method) — Whether tmux is told not to give the session a size at all.
- `detachOthers` (method) — Whether other clients on this session are detached.
- `clientFlags` (method) — Client flags, which tmux takes as one comma-separated list.
- `command` (method) — What the session's first pane runs, empty for the default shell.
- `argv` (method) — The command that makes this session, reporting it through {@code format}.
- `toString` (method)
- `Builder` (class) — Collects the choices, each named for what it does rather than for the field it sets.
