Window.applyLayout
Restores an exact arrangement previously read from #layout().
Source and package
- Qualified name
-
io.github .libtmux .Window. apply Layout - Package
- io.github.libtmux
- Declared in
Window- Distribution
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/Window.java
- @Operation(Kind
.MUTATION ) public void applyLayout(WindowLayout layout)@Operation(Kind.MUTATION ) public void applyLayout(String layout) -
Description#
The string is checked here rather than by tmux, because tmux 3.3a does not survive being handed one it cannot parse: it ends the server and every session on the socket. Every other supported release answers
invalid layout. The classic form carries tmux's own checksum, so a wrong one is detectable without asking; since 3.8 tmux may instead hand back JSON, which carries no checksum, so that shape is only trusted from a server new enough to have written it."Exact" holds in full only for a JSON layout, since that is the one form carrying each pane's id. A classic string — every release before 3.8, or an older reader against a newer server — restores the geometry but names no pane, so which process lands in which cell can differ from where it started; whether it does depends on whether the pane list still happens to match the order the layout was saved in. Confirmed by hand on 3.7c.
- Parameters
- Raises
-
-
Illegal
Argument – if the string is not a layout tmux wroteException -
Unsupported
Feature – if it is JSON-shaped but this server predates JSON layoutsException
-
tmux command#
The tmux commands behind applyLayout.
tmux C API#
The C declarations in tmux that implement these commands.