# io.github.libtmux.Layouts.Layouts

- **Module:** io.github.libtmux.Layouts
- **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/Layouts.java#L26
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-layouts-layouts/

Which layout names are safe to hand to tmux.

Public because every path that can reach select-layout needs it, not only the one that reads
a workspace file. This check exists because an unrecognised layout name does not produce an error on every tmux:
on 3.3a it crashes the server, taking down every session on that socket, including ones this
program never created. A workspace file is user-supplied text, so the name has to be checked
before it is dispatched rather than after tmux has had it.

tmux accepts either one of its named layouts or a serialized layout tmux itself produced. Since
3.8 that serialized form is either the classic checksummed grammar or JSON, and {@code
select-layout} takes either back - but only JSON round-trips exactly. The classic grammar
carries no pane identity, only shape, so which process lands in which cell can differ from
where it started; see {@link Window#applyLayout}. The classic checksum is verified here; a
four-hex-digit prefix alone does not make the rest safe for tmux to parse. JSON carries no such
signature, so a JSON-shaped string is only trusted once the running tmux is new enough to have
written it - see {@link #requireSerialized}.

## Members

- `require` (method): Returns the layout unchanged, having checked tmux will recognise it.
- `builtIn` (method): The built-in layout a name or an unambiguous prefix of one denotes, resolved against what {@code running} actually supports — the same resolution {@link #require(String, TmuxVersion)} applies, exposed so a caller that must choose between the enum path and a raw string (a workspace file's own dispatch) makes the same choice the guard just validated.
- `requireSerialized` (method): Requires an exact layout string rather than a built-in layout name.
