# io.github.libtmux.batch.Batch.Batch

- **Module:** io.github.libtmux.batch.Batch
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** class
- **Source:** https://github.com/libtmux/libtmux-java/blob/c3517519ee799428a809ce6deb1708c8be289cd1/libtmux/src/main/java/io/github/libtmux/batch/Batch.java#L22
- **Page:** https://libtmux.org/reference/java/io-github-libtmux-batch-batch-batch/

Several tmux commands in one invocation, each with an outcome of its own.

<p>tmux runs a group until a command fails and then discards the rest, so the number of replies
cannot say which command failed: an error in the first position and an error in the last both
come back as one nonzero exit. Counting replies is wrong in every position but one.

<p>A marker is therefore interleaved after each operation. Markers are discarded along with
everything else after a failure, so the last marker seen is exactly the last operation tmux ran,
and the operations either side of that boundary are known rather than guessed.

## Members

- `Batch` (method) — Collects operations to run together.
- `add` (method) — Adds one tmux command, its arguments already separate elements.
- `size` (method) — How many operations have been collected.
- `length` (method) — How many bytes the collected operations come to as the one command tmux parses.
- `run` (method) — Runs every collected operation in one tmux invocation.
