On this page
selection.Selection.one
- Module
- selection
- Declared in
- Selection
- Package
- @libtmux/libtmux
- Source
- packages/libtmux/src/selection.ts
-
The single member, or the single one matching
criteria.Throws
NoMatchErrorfor none andMultipleMatchesErrorfor several, so "exactly one" is enforced rather than assumed — afirstthat silently takes the head of two is how the wrong pane gets driven.An id is not always one member. A window linked into two sessions, or shared by two grouped sessions, has a placement in each and both carry the same id, so
one({ id })raises for a perfectly good id. Add the session to say which placement is meant.Examples
const only = snapshot.sessions.one({ name: "work" }); only.id;Discussed in Filtering and queries
0 declared, 0 inherited