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

LibTmux\New-TmuxQuery LibTmux\New-TmuxQuery

Build reusable criteria for captured tmux objects.

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

Description#

Construct a native LibTmux query document from a criteria map or serialized schema 2 JSON. Construction copies and validates data without contacting tmux. Use Where-Object for ordinary PowerShell predicates; structured criteria also support serialization, field discovery and explicit source planning.

Map keys use native property names or catalog wire names. Bare values mean equality; fields in a map are combined with And. Use operator maps such as @{ Width = @{ Ge = 80 } }. Get-TmuxQueryField lists native catalog fields and operator names. The criteria reference maps those names to accepted PowerShell keys such as Ge, Some and Is. Unknown fields, duplicate aliases, unsupported operators, ScriptBlocks, cycles and oversized data are rejected before evaluation.

Notes

Tmux.InvalidQuery terminates invalid construction. The packaged libtmux-query-v2.schema.json describes the JSON representation.

Command details#

Command type
cmdlet
Default parameter set
Criteria
Positional binding
Enabled.
Pipeline inputs
None: No pipeline input.
Outputs
LibTmux.Query.QueryDocument

Examples#

Example 1 Build a reusable filter for panes at least 80 columns wide. View source

Terminal window
LibTmux\New-TmuxQuery -Target Pane -Criteria @{ Width = @{ Ge = 80 } }
Parameters
Common parameters 12

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

Returns

LibTmux.Query.QueryDocument : One validated native document.

Discussed in Local selection and source queries

Esc

Type to search.

Reference preview Open reference