Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux_erlang has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-erlang latest

tmux_server:snapshot/2

Capture the server's sessions, physical windows, window links and panes.

Source and package
Qualified name
tmux_server:snapshot/2
Declared in
tmux_server
Package
libtmux_erlang
Source
apps/libtmux_erlang/src/tmux_server.erl
snapshot(Server, Options) -spec snapshot(t(), capture_options()) -> {ok, tmux_snapshot:t()} | {error, map()}.

Description#

This performs explicit I/O and records each command's observation interval. Identity scans bracket field reads; detected topology or value disagreements return inconsistent_capture. Changes between reads can remain undetected, including changes followed by a reversal. Atomic capture is unsupported.

Options are consistency (observed only), deadline_ms (default 2500, maximum 600000), max_rows (4096, maximum 65536 raw observations per scan and aggregate spine) and max_bytes (8 MiB, maximum 64 MiB total stdout across capture commands). Repeated memberships count before deduplication. The hydration/0 strategy defaults to batched. Each command is limited to 1 MiB; isolated hydration distributes larger entity output across individual fields. These are data limits, not a VM heap limit. Capturing performs no retry. Local reads of the resulting value do no I/O. tmux_snapshot:metadata/1 records the strategy and actual source calls.

Unsupported consistency is rejected before contacting a server:

Examples#

1> tmux_server:snapshot(invalid_server, #{consistency => atomic}).
{error,#{code => unsupported_consistency}}
Parameters

tmux command#

The tmux commands behind snapshot/2.

list-panes -a server scope, cmd_list_panes_server (the server has a session) list-sessions list-windows -a server scope, cmd_list_windows_exec (the server has a session)

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference