WindowLayout
A window's layout as tmux reported it, in whichever of its two forms it used.
Source and package
- Qualified name
-
io.github .libtmux. Window Layout - Package
- io.github.libtmux
- Distribution
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/WindowLayout.java
-
Description#
tmux writes a layout in its classic checksummed form —
c3a4,80x24,0,0,1— on every release before 3.8, and as JSON from 3.8, which also names the pane in each cell. The same window therefore reports a differently shaped string depending on the server, and a caller that parses it needs to know which it has. This says, so the compiler can carry what used to be a comment:Either form is an opaque token to hand back to tmux, which
Window#applyLayout(WindowLayout)does; parsing one is tmux's job, and#value()is the text for a caller who wants to anyway.Examples#
switch (window.layout()) {case WindowLayout.Json json -> restorePanes(json.value());case WindowLayout.Classic classic -> restoreGeometry(classic.value());}