SessionFilter
SessionFilter matches materialized Session values without tmux I/O. Its zero value matches every non-nil candidate. Criteria are ANDed; AnyOf adds an OR requirement and Not excludes. Field and relation criteria correspond to Session.ID, Session.Name, Session.Attached, Session.Windows, and Session.Panes. SessionFilter.Validate and methods that consume the filter reject invalid criteria with ErrInvalidFilter.
Source and package
- Qualified name
-
tmux.Session Filter - Package
- tmux
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/filter_generated.go
Fields11#
| Name | Type | Description |
|---|---|---|
| Windows | *Window | Windows traverses the materialized window views returned by Session.Windows. A nil pointer leaves the relation criterion unset. |
| Panes | *Pane | Panes traverses the materialized pane views returned by Session.Panes. A nil pointer leaves the relation criterion unset. |
| AnyOf | []Session | AnyOf additionally requires at least one branch to match after ordinary criteria match. A nil slice leaves AnyOf unset; a non-nil empty slice is invalid. |
| Attached | *bool | Attached exactly matches the materialized attachment state from Session.Attached. A nil pointer leaves Attached unset; a non-nil pointer applies it, including when it points to the zero value. |
| ID | *Session | ID exactly matches the stable tmux session identifier from Session.ID, including its $ sigil. A nil pointer leaves ID unset; a non-nil pointer applies it, including when it points to the zero value. |
| IDIn | []Session | IDIn lists accepted values for the stable tmux session identifier from Session.ID, including its $ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves IDIn unset; a non-nil empty slice is invalid. |
| Name | *string | Name exactly matches the materialized session name from Session.Name. A nil pointer leaves Name unset; a non-nil pointer applies it, including when it points to the zero value. |
| NameContains | *string | NameContains requires the materialized session name from Session.Name to contain the pointed-to substring. A nil pointer leaves NameContains unset; a non-nil pointer applies it, and an empty string matches every available string. |
| NameIn | []string | NameIn lists accepted values for the materialized session name from Session.Name. A candidate matches when its materialized value equals one listed value. A nil slice leaves NameIn unset; a non-nil empty slice is invalid. |
| NameRegex | string | NameRegex requires the materialized session name from Session.Name to match Go regular expression syntax. An empty string leaves NameRegex unset. |
| Not | *Session | Not excludes a candidate when its nested filter matches. A nil pointer leaves Not unset. |
Members4#
- MarshalJSON method MarshalJSON validates and encodes the session filter; failures wrap
ErrInvalidFilter. - Predicate method Predicate validates the session filter and returns a local predicate for
Sessionvalues materialized by aSnapshot; it never runs tmux. It traverses only loaded relations and returns false for a nil candidate. - UnmarshalJSON method UnmarshalJSON clears the receiver, strictly decodes a session filter, then validates it. Unknown or duplicate fields, trailing data, and semantic failures wrap
ErrInvalidFilter; the receiver may retain decoded state on error. - Validate method Validate checks structure, regular expressions, and contradictory criteria; failures wrap
ErrInvalidFilter.
Guides#
Pages that discuss SessionFilter.