Core Library0.xAPI Reference

Choose documentation 2

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.

cmdlet libtmux-powershell latest

LibTmux.Get-TmuxSnapshot

Capture a replacement tmux hierarchy.

Source and package
Qualified name
LibTmux\Get-TmuxSnapshot
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/GetTmuxSnapshotCommand.cs
Other languages
Juliafunction Elixirfunction Python RubyLuaTypeScriptRustmethod GoJavaC# C++ SwiftKotlinScalaF#function

Description#

Read the explicit server endpoint to the requested Depth. The default Panes depth captures sessions, contextual windows and panes. Shallower snapshots leave deeper relations unavailable. The input handle and previous captures remain unchanged.

SnapshotMetadata records depth, daemon generation, UTC start/end readings and monotonic Elapsed time. Use Elapsed for duration because UTC can be adjusted. Even Server depth performs a fresh generation-guarded read.

Captured parents and active children retain their exact graph instances when the requested depth includes them. Repeated links keep their session/index placement; filtering panes does not prune their parent's captured relations.

Notes

Acquisition spans multiple tmux commands and does not promise an atomic view. Contradictory topology or active references fail with InconsistentSnapshotException without publishing a partial graph or retrying. Equal-count changes can escape detection. Tmux.SnapshotFailed retains the native exception and target; use ErrorAction Stop to stop later owners. Property access uses captured data; unavailable relations throw rather than appearing empty.

Command details#

Command type
cmdlet
Positional binding
Enabled.
Pipeline inputs
LibTmux.Server: Native pipeline type for this command.
Outputs
LibTmux.Server

Examples#

Example 1 Capture the hierarchy of the existing server identified by $SocketPath. View source

Terminal window
LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\Get-TmuxSnapshot -Depth Panes
Parameters
Common parameters 12

PowerShell supplies these parameters. See common parameter behavior for their effects.

Returns

LibTmux.Server: Native pipeline type for this command.

Guides#

Pages that discuss Get-TmuxSnapshot.

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
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.
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
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