# io.github.libtmux.CommandChain.CommandChain

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

A sequence of tmux commands where each one acts on what the last one made.

tmux moves its own current target as a group runs: a {@code new-window} makes the new window
current, a following {@code split-window} splits that window, and a following {@code send-keys}
types into the pane that split produced. None of these steps names a target, and that is the
point — the alternative is a round trip per step to learn the id of the thing just created.

The whole chain is one tmux invocation, and every step is attributed individually, so a chain
that fails halfway says which step failed and which never ran.

## Members

- `CommandChain` (method)
- `newWindow` (method): Creates a window and makes it the one following steps act on.
- `renameWindow` (method): Renames the current window.
- `splitLeftRight` (method): Splits the current pane into a left and a right one.
- `splitTopBottom` (method): Splits the current pane into a top and a bottom one.
- `sendLine` (method): Types a line into the current pane and presses Enter, which is how a command gets run.
- `arrange` (method): Arranges the current window.
- `then` (method): Adds any tmux command, for whatever this class does not name.
- `run` (method): Runs the whole chain in one tmux invocation, attributing each step.
