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

Acquire fresh tmux objects using an explicit query.

Source and package
Qualified name
LibTmux\Invoke-TmuxQuery
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.

Command details#

Command type
cmdlet
Default parameter set
Query
Positional binding
Enabled.
Pipeline inputs
LibTmux.Server: An explicit server endpoint.
Outputs
LibTmux.Session, LibTmux.Window, LibTmux.Pane, LibTmux.Query.QueryResult[LibTmux.Session], LibTmux.Query.QueryResult[LibTmux.Window], LibTmux.Query.QueryResult[LibTmux.Pane]

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.

Guides#

Pages that discuss Invoke-TmuxQuery.

Esc

Type to search.

Reference previewOpen reference