# io.github.libtmux.WindowSpec.WindowSpec.Builder

- **Module:** io.github.libtmux.WindowSpec.WindowSpec
- **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/WindowSpec.java#L166
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-windowspec-windowspec-builder-1f6n/

Collects the choices, each named for what it does rather than for the field it sets.

## Members

- `named` (method) — Names the window, where tmux would otherwise name it after what runs in it.
- `after` (method) — Puts the window immediately after the current one.
- `before` (method) — Puts the window immediately before the current one.
- `running` (method) — Runs a command instead of the session's shell.
- `in` (method) — Starts the window in this directory. Requires tmux 3.3a.
- `env` (method) — Sets one variable in the new window's environment.
- `environment` (method) — Adds several variables to the new window's environment, keeping any already set.
- `detached` (method) — Leaves the current window selected, where tmux would move to the new one.
- `atIndex` (method) — Creates the window at a chosen index rather than the next one tmux has free.
- `replaceExisting` (method) — Destroys whatever window already sits at the index chosen by {@link #atIndex}.
- `reuseExisting` (method) — Selects a window that already carries this name rather than making a second.
- `build` (method) — The finished spec.
