Core LibraryAPI Reference

Choose documentation 2

latest

Current version

latest
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

cmdlet libtmux-powershell latest

LibTmux.Get-TmuxSnapshot

LibTmux\Get-TmuxSnapshot LibTmux\Get-TmuxSnapshot

Capture a replacement tmux hierarchy.

Source and package
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/GetTmuxSnapshotCommand.cs
Other languages
Julia (function) Python RubyLuaTypeScript Rust 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.

Discussed in Captured state and I/O · Create windows and panes · Getting started , Read tmux objects

In other ports Capture the tmux hierarchy
Esc

Type to search.

Reference preview Open reference