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

Filter captured native sessions.

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

Guides#

Pages that discuss Select-TmuxSession.

Esc

Type to search.

Reference previewOpen reference