Capture
Builds a bounded one-shot observation of one existing Linux tmux server.
Source and package
- Qualified name
-
LibTmux. Capture - Module
- LibTmux
- Package
- libtmux
- Source
- lib/libtmux/capture.ex
-
Description
Capture checks topology and OS server identity before and after field reads. Attempts share the original deadline and work budgets;
attemptsdefaults 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.
Members4 members
- diagnostics/0: diagnostics() :: %{
commands: non
_neg (), bytes: non_integer _neg (), fallbacks: [fallback()] } typealias Actual capture work across attempts and the fallback decisions in execution order._integer - fallback/0: fallback() :: %{
attempt: 1..3,
entity: :session | :window | :pane,
fields: [atom()],
reason: :stdout_bytes | :total_bytes,
response_limit: pos
_integer (), bulk_command: pos_integer (), bulk_bytes: non_neg (), batch_commands: non_integer _neg (), batch_bytes: non_integer _neg (), individual_commands: non_integer _neg (), individual_bytes: non_integer _neg () } typealias A retired oversized text listing and the batch and individual reads it triggered._integer - fetch/2 function Performs bounded capture through an explicit server descriptor.
- option/0: option() ::
{:timeout, pos
_integer ()} | {:deadline, LibTmux ()} | {:attempts, 1..3} | {:max_entities | :max_commands | :max_bytes | :max_response_bytes, pos.Deadline .t _integer ()} typealias Capture-wide budgets shared by all attempts and reads.