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.Select-TmuxSession

LibTmux\Select-TmuxSession LibTmux\Select-TmuxSession

Filter captured native sessions.

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

Description#

Evaluate criteria against captured native objects using the shared .NET query evaluator. Selection preserves input order, duplicates, object identity and the complete graph behind each object. It does not contact tmux or refresh data. Use Where-Object when an ordinary PowerShell predicate is sufficient.

Ordinary selection streams each match. ExactlyOne retains a match until finite input completes, then emits it only if exactly one input matched. A second match, invalid object, unavailable captured relation, evaluation failure or pipeline stop terminates selection before that retained object is emitted. ExactlyOne counts only the successful objects it receives. An upstream nonterminating error is outside that guarantee. When completeness is required before mutation, use -ErrorAction Stop on every upstream acquisition.

Notes

Errors terminate even with -ErrorAction Continue. Tmux.NoMatch and Tmux.MultipleMatches report cardinality failures. Tmux.InvalidQuery reports invalid criteria or a mismatched target; Tmux.QuerySelectionFailed retains the native evaluation exception and failing input. ExactlyOne cannot prove cardinality on an input stream that never completes.

Command details#

Command type
cmdlet
Default parameter set
Criteria
Positional binding
Enabled.
Pipeline inputs
LibTmux.Session : Captured native sessions; no property-name binding.
Outputs
LibTmux.Session

Examples#

Example 1 Capture the existing endpoint selected by $SocketPath , then select detached sessions. View source

Terminal window
$snapshot = LibTmux\New-TmuxServer -SocketPath $SocketPath |
LibTmux\Get-TmuxSnapshot
$snapshot.Sessions |
LibTmux\Select-TmuxSession -Criteria @{ Attached = $false }
Parameters
Common parameters 12

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

Returns

LibTmux.Session : The original matching objects.

Discussed in Local selection and source queries · Create windows and panes

Esc

Type to search.

Reference preview Open reference