# LibTmux.Capture

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/capture.ex#L1
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-capture/

Builds a bounded one-shot observation of one existing Linux tmux server.

Capture checks topology and OS server identity before and after field
reads. Attempts share the original deadline and work budgets; `attempts`
defaults to 2 and accepts 1–3. Only inconsistent topology or disappearing
read targets retry. Decoding and coverage errors remain visible.

Defaults: 1024 topology rows, 512 commands, 8 MiB total response bytes,
64 KiB per response and 5000 ms. Exhausted capture-wide budgets return an
error, never a partial success. Both topology scans count contextual linked rows.
With no sessions, a second empty session listing and the same server
identity establish an empty graph.

Populated captures use one encoded listing per entity kind. One successful
attempt uses 13 commands when the three free-form listings fit. After a listing
exceeds the response ceiling and its client retires, capture splits pane
listings into smaller ID ranges and can read a pane individually. Session
and window listings fall back to individual reads. Every response consumes
the original budgets, including duplicate linked rows and failed listings.
Capture adds no control attachment. Hooks configured on list commands can
still have effects; retries do not replay application mutations.

## Members

### Other members

- [`diagnostics/0`](/en/elixir/pr-173/reference/libtmux-capture-diagnostics-0/) (typealias): Actual capture work across attempts and the fallback decisions in execution order.
- [`fallback/0`](/en/elixir/pr-173/reference/libtmux-capture-fallback-0/) (typealias): A retired oversized text listing and the batch and individual reads it triggered.
- [`fetch/2`](/en/elixir/pr-173/reference/libtmux-capture-fetch-2/) (function): Performs bounded capture through an explicit server descriptor.
- [`option/0`](/en/elixir/pr-173/reference/libtmux-capture-option-0/) (typealias): Capture-wide budgets shared by all attempts and reads.
