Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-ts latest

Server.snapshot

Acquire an immutable view of the server at this instant.

Source and package
Qualified name
Server.snapshot
Module
server
Declared in
Server
Package
libtmux
Source
packages/libtmux/src/server.ts
Other languages
PowerShellcmdlet Juliafunction Elixirfunction Python RubyLuaRustmethod GoJavaC# C++ SwiftKotlinScalaF#function

Description#

Acquisition is the only step that talks to tmux. Everything reachable from the returned value resolves locally, so traversal and filtering issue no commands and an earlier snapshot keeps reporting its own instant. daemonIdentity() identifies the daemon captured with these collections.

Examples#

const now = await server.snapshot();
now.daemonIdentity.pid;
now.windows.count();
Parameters

tmux command#

The tmux commands behind snapshot.

tmux C API#

The C declarations in tmux that implement these commands.

Guides#

Pages that discuss snapshot.

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.
Elixir LibTmux.Server.snapshot/2 Captures a new graph over an observation interval. A retained Snapshot never refreshes.
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
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()
Esc

Type to search.

Reference previewOpen reference