Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

interface libtmux-java latest

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.WindowLayout
Package
io.github.libtmux
Distribution
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/WindowLayout.java
interface io.github.libtmux.WindowLayout

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());
}

Members4#

  • Classic class The checksummed form every release writes before 3.8. It carries geometry and no pane ids.
  • Json class The JSON form tmux writes from 3.8, which names the pane in each cell.
  • of method Which form a reported layout is in.
  • value method The layout exactly as tmux reported it.
Esc

Type to search.

Reference previewOpen reference