Core LibraryunreleasedAPI Reference

Choose documentation 2

latest

Current version

latest
English

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

method libtmux-perl latest

Server.snapshot

See "snapshot" in LibTmux::Server for arguments, returned value, and completion.

Source and package
Qualified name
LibTmux::Async::Server::snapshot
Module
LibTmux::Async
Declared in
Server
Package
LibTmux-Async
Source
packages/async/lib/LibTmux/Async/Server.pm
Other languages
Erlangfunction PowerShellcmdlet Juliafunction Elixirfunction Haskell Common Lispfunction Python RubyLuaTypeScriptRustmethod GoJavaC# C++ SwiftKotlinScalaOCamlfunction F#function Clojurefunction
sub snapshot($self, %args)

Methods#

Examples#

Complete installed-package program with an owned tmux fixture and result/cleanup assertions. View source

use v5.44;
use FindBin;
use lib "$FindBin::Bin/../scripts/lib";
use IO::Async::Loop::Ppoll;
use LibTmux::Async::Server;
use LibTmuxFixture;
LibTmuxFixture->run(
sub ($sync, $root) {
$sync->new_session(
name => 'async-example',
command => ['/bin/sleep', '120']
);
my $loop = IO::Async::Loop::Ppoll->new;
my $server = LibTmux::Async::Server->new(
loop => $loop,
socket_path => "$root/s",
executable => $ENV{LIBTMUX_TEST_TMUX} // 'tmux',
max_concurrent => 2
);
my $snapshot = $server->snapshot;
$loop->await($snapshot);
die 'async snapshot missing pane'
unless $snapshot->get->panes->count == 1;
my $closed = $server->close;
$loop->await($closed);
die 'cleanup failed' unless $closed->is_done;
say 'async capture and cleanup: ok';
}
);
Parameters

tmux command#

The tmux commands behind snapshot.

display-message (daemon identity or target preflight) list-clients list-panes -a server scope, cmd_list_panes_server list-sessions list-windows -a server scope, cmd_list_windows_exec

tmux C API#

The C declarations in tmux that implement these commands.

In other ports#

Capture the tmux hierarchy

Equivalents of Capture the tmux hierarchy in other languages
Language Equivalent
Python no equivalent on Server
Ruby LibTmux::Server#snapshot
Lua libtmux.Server:snapshot
PowerShell LibTmux\Get-TmuxSnapshot Acquires a replacement LibTmux.Server to -Depth (panes by default). Acquisition is not atomic; retained handles do not refresh.
Julia LibTmux.snapshot Acquires a new Snapshot over an observation interval. Topology checks do not make it a transaction; earlier snapshots do not refresh.
Erlang tmux_server:snapshot/1 Captures a new graph over an observation interval. Retained snapshots never refresh.
Elixir LibTmux.Server.snapshot/2 Captures a new graph over an observation interval. A retained Snapshot never refreshes.
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
Common Lisp libtmux:fetch-snapshot fetch-snapshot acquires a new interval observation. Retained snapshots never refresh in place.
TypeScript server.Server.snapshot
Rust server.Server.hierarchy Fetches the whole hierarchy with list-sessions, list-windows -a and list-panes -a, and stitches the rows by winlink. The three listings are separate commands, so the capture is not an atomic transaction.
Go tmux.Server.Snapshot
Java io.github.libtmux.Server.snapshot
Clojure libtmux.core/snapshot! Acquires a captured graph of persistent values. Retained values do not refresh after mutation or close.
Kotlin io.github.libtmux.kotlin.Server.snapshot
Scala io.github.libtmux.scaladsl.Server.snapshot
C# LibTmux.Server.CaptureSnapshotAsync
F# LibTmux.FSharp.Server.capture Acquires a replacement shared .NET LibTmux.Server to the requested depth. Acquisition is not atomic; retained handles do not refresh.
C++ no equivalent on Server: sessions, windows, panes and clients each take a snapshot of one listing, and Snapshot::take needs the internal detail::Backend, so no public call reads the whole hierarchy at once
Swift Server.snapshot()
OCaml Libtmux_unix.Client.capture Acquires a complete immutable graph over an interval. Earlier observations remain readable without refreshing.
Esc

Type to search.

Reference previewOpen reference