# LibTmux::Selection

- **Package:** LibTmux
- **Language:** Raku
- **Kind:** module
- **Source:** https://github.com/libtmux/libtmux-raku/blob/e76160bcce6e03976d49424da15b7c31afb2c68e/lib/LibTmux/Selection.rakumod#L2
- **Page:** https://libtmux.org/en/raku/latest/reference/libtmux-selection/

# Captured selections

A concrete selection consumes ` Selection[Pane, 'pane'] ` or another catalogue
entity schema. ` new(:items) ` copies finite, eager, defined membership. It does
not deep-clone member objects. Observation classes must supply their own
read-only field contract.

Binding ` my @panes := $snapshot.panes ` preserves the selection. Array
assignment materializes ordinary array membership; assigning to a scalar
itemizes the selection. Use ` $panes.List ` when explicit list traversal is
wanted. Each iterator and Seq is fresh. Array conversion is independently
mutable; List membership cannot be replaced.

` where ` accepts criterion data or a compiled Filter and validates the schema
before traversal. ` filter ` invokes one callback per member, eagerly in source
order, and throws a directly returned Failure before Boolean coercion. Both
return the same concrete selection type and preserve order and duplicates.
Native ` grep `, ` map `, ` sort `, ` first ` and junctions delegate to the captured
List, including grep adverbs. They retain native return and evaluation rules.
` one ` constructs a junction; exact cardinality uses ` single `.

## Members

### Other members

- [`Selection`](/en/raku/latest/reference/libtmux-selection-selection/) (trait): Eager captured membership; transformations perform no acquisition or commands.
