WindowFilter
WindowFilter matches materialized Window 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 Window.SessionID, Window.ID, Window.Index, Window.Name, Window.Active, Window.Session, and Window.Panes. WindowFilter.Validate and methods that consume the filter reject invalid criteria with ErrInvalidFilter.
Source and package
- Qualified name
-
tmux.Window Filter - Package
- tmux
- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/filter_generated.go
Fields19#
| Name | Type | Description |
|---|---|---|
| Panes | *Pane | Panes traverses the materialized pane views returned by Window.Panes. A nil pointer leaves the relation criterion unset. |
| Active | *bool | Active exactly matches the materialized active state from Window.Active. A nil pointer leaves Active unset; a non-nil pointer applies it, including when it points to the zero value. |
| AnyOf | []Window | 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. |
| ID | *Window | ID exactly matches the stable tmux window identifier from Window.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 | []Window | IDIn lists accepted values for the stable tmux window identifier from Window.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. |
| Index | *int | Index exactly matches the nonnegative winlink index from Window.Index. A nil pointer leaves Index unset; a non-nil pointer applies it, including when it points to the zero value. |
| IndexGT | *int | IndexGT requires the nonnegative winlink index from Window.Index to be strictly greater than the pointed-to value. A nil pointer leaves IndexGT unset; a non-nil pointer applies it, including when it points to the zero value. |
| IndexGTE | *int | IndexGTE requires the nonnegative winlink index from Window.Index to be greater than or equal to the pointed-to value. A nil pointer leaves IndexGTE unset; a non-nil pointer applies it, including when it points to the zero value. |
| IndexIn | []int | IndexIn lists accepted values for the nonnegative winlink index from Window.Index. A candidate matches when its materialized value equals one listed value. A nil slice leaves IndexIn unset; a non-nil empty slice is invalid. |
| IndexLT | *int | IndexLT requires the nonnegative winlink index from Window.Index to be strictly less than the pointed-to value. A nil pointer leaves IndexLT unset; a non-nil pointer applies it, including when it points to the zero value. |
| IndexLTE | *int | IndexLTE requires the nonnegative winlink index from Window.Index to be less than or equal to the pointed-to value. A nil pointer leaves IndexLTE unset; a non-nil pointer applies it, including when it points to the zero value. |
| Name | *string | Name exactly matches the materialized window name from Window.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 window name from Window.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 window name from Window.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 window name from Window.Name to match Go regular expression syntax. An empty string leaves NameRegex unset. |
| Not | *Window | Not excludes a candidate when its nested filter matches. A nil pointer leaves Not unset. |
| Session | *Session | Session traverses the materialized parent returned by Window.Session. A nil pointer leaves the relation criterion unset. |
| SessionID | *Session | SessionID exactly matches the stable tmux session identifier from Window.SessionID, including its $ sigil. A nil pointer leaves SessionID unset; a non-nil pointer applies it, including when it points to the zero value. |
| SessionIDIn | []Session | SessionIDIn lists accepted values for the stable tmux session identifier from Window.SessionID, including its $ sigil. A candidate matches when its materialized value equals one listed value. A nil slice leaves SessionIDIn unset; a non-nil empty slice is invalid. |
Members4#
- MarshalJSON method MarshalJSON validates and encodes the window filter; failures wrap
ErrInvalidFilter. - Predicate method Predicate validates the window filter and returns a local predicate for
Windowvalues 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 window 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 WindowFilter.