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
- NativeFilter: Invoke-TmuxQuery [-Server] <Lib
Tmux > -Target <Lib.Server Tmux > -Native.Query .Query Target Filter <System.String > [<CommonParameters >] Plan: Invoke-TmuxQuery [-Server] <LibTmux > -Plan <System.Server .Object > [-AsResult ] [<CommonParameters >] Query (default): Invoke-TmuxQuery [-Server] <LibTmux > -Query <Lib.Server Tmux > [-Pushdown <Lib.Query .Query Document Tmux >] [-As.Query .Query Pushdown Result ] [<CommonParameters >] -
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. UseSelect-TmuxPane,Select-TmuxWindoworSelect-TmuxSessionfor local filtering of objects already acquired.NativeFilteris a separate raw tmux-format escape hatch. It returns matching rows without a complete structured-query snapshot. It cannot be combined with Query,Plan,Pushdownor AsResult.Notes
Execution failures write
Tmux.QueryExecutionFailedfor the affected endpoint. UseErrorActionStop 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 $queryExample 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
-
-
The explicit endpoint to inspect and query.
- Required
- Yes
- Position
- 0
- Pipeline input
- By value
- Validation
ValidateNotNull()
-
-Target(LibTmux ) (for.Query .Query Target NativeFilter) #The native entity searched by
NativeFilter.- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateSet(["Session","Window","Pane"])
-
-NativeFilter(System.String ) (forNativeFilter) #Uninterpreted tmux format text. The caller owns its semantics; it is not a structured portable query.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNullOrEmpty()
-
-Plan(System.Object ) (forPlan) #A native
QueryPlan<Session>,QueryPlan<Window> orQueryPlan<Pane> prepared byGet-TmuxQueryPlanor the .NET API.- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNull()
-
-AsResult(System.Management ) (for.Automation .Switch Parameter Plan;Query) #Emit one native result with matches and its complete captured graph.
- Required
- No
- Position
- Named
- Pipeline input
- No
- Switch
- Yes
- Default
False
-
-Query(LibTmux ) (for.Query .Query Document Query) #A native document planned using the observed daemon version.
- Required
- Yes
- Position
- Named
- Pipeline input
- No
- Validation
ValidateNotNull()
-
-Pushdown(LibTmux ) (for.Query .Query Pushdown Query) #Autopermits exact source evaluation and local residuals;Neverevaluates locally;Requirerejects residual predicates.- Required
- No
- Position
- Named
- Pipeline input
- No
- Default
-
Auto - Validation
ValidateSet(["Auto","Never","Require"])
Common parameters 12
PowerShell supplies these parameters. See common parameter behavior for their effects.
-
-Verbose(System.Management ) #.Automation .Switch Parameter Display verbose messages produced by this command.
Aliases:vbMicrosoft Learn reference -
-Debug(System.Management ) #.Automation .Switch Parameter Display debug messages produced by this command.
Aliases:dbMicrosoft Learn reference -
-ErrorAction(System.Management ) #.Automation .Action Preference Choose how this command responds to non-terminating errors.
Aliases:eaMicrosoft Learn reference -
-WarningAction(System.Management ) #.Automation .Action Preference Choose how this command responds to warning messages.
Aliases:waMicrosoft Learn reference -
-InformationAction(System.Management ) #.Automation .Action Preference Choose how this command handles information messages.
Aliases:infaMicrosoft Learn reference -
-ProgressAction(System.Management ) #.Automation .Action Preference Choose how this command handles progress updates.
Aliases:progaMicrosoft Learn reference -
-ErrorVariable(System.String ) #Store the command's error records in the named variable.
Aliases:evMicrosoft Learn reference -
-WarningVariable(System.String ) #Store the command's warning records in the named variable.
Aliases:wvMicrosoft Learn reference -
-InformationVariable(System.String ) #Store the command's information records in the named variable.
Aliases:ivMicrosoft Learn reference -
-OutVariable(System.String ) #Save output in the named variable while passing it down the pipeline.
Aliases:ovMicrosoft Learn reference -
Buffer output before passing it to the next pipeline command.
Aliases:obMicrosoft Learn reference -
-PipelineVariable(System.String ) #Make the most recent output object available through a named variable within the pipeline.
Aliases:pvMicrosoft Learn reference
-
- Returns
-
LibTmux.Session:Matchingsessions.LibTmux.Window:Matchingwindow placements.LibTmux.Pane:Matchingpanes in their captured placement context. `LibTmux.Query.QueryResult<T>`:Onenative result when AsResult is set.
Discussed in Local selection and source queries