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

LibTmux\Invoke-TmuxQuery LibTmux\Invoke-TmuxQuery

Acquire fresh tmux objects using an explicit query.

Source and package
Declared in
LibTmux
Package
LibTmux
Source
src/LibTmux.PowerShell/InvokeTmuxQueryCommand.cs

Description#

Inspect the supplied endpoint, acquire a fresh snapshot and emit matching native objects in captured order. A query document is planned against the observed daemon version. A prepared plan must match that version. Execution never starts an absent daemon.

Use AsResult to retain one native QueryResult , including its complete snapshot when there are no matches. Filtering does not prune parent or child relations. Acquisition spans tmux commands and does not promise an atomic observation. Use Select-TmuxPane , Select-TmuxWindow or Select-TmuxSession for local filtering of objects already acquired.

NativeFilter is a separate raw tmux-format escape hatch. It returns matching rows without a complete structured-query snapshot. It cannot be combined with Query, Plan , Pushdown or AsResult.

Notes

Execution failures write Tmux.QueryExecutionFailed for the affected endpoint. Use ErrorAction Stop to terminate the pipeline. Cancellation stops the pending native operation. No matches are emitted from a failed acquisition.

Examples#

Example 1 Acquire panes at least 80 columns wide from an explicit socket. View source

Terminal window
$query = LibTmux\New-TmuxQuery -Target Pane -Criteria @{ Width = @{ Ge = 80 } }
LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\Invoke-TmuxQuery -Query $query

Example 2 Keep the query result and its captured graph, including an empty selection. View source

Terminal window
$query = LibTmux\New-TmuxQuery -Target Pane -Criteria @{ Width = @{ Ge = 80 } }
LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\Invoke-TmuxQuery -Query $query -AsResult
Parameters
Common parameters 12

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

Returns

LibTmux.Session : Matching sessions. LibTmux.Window : Matching window placements. LibTmux.Pane : Matching panes in their captured placement context. ` LibTmux.Query.QueryResult <T>`: One native result when AsResult is set.

Discussed in Local selection and source queries

Esc

Type to search.

Reference preview Open reference