ControlClient.Notifications
Notifications returns an iterator over what tmux says without being asked: pane output, and the events behind ControlNotification.
Source and package
- Qualified name
-
tmux.Control Client. Notifications - Package
- tmux
- Declared in
ControlClient- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/control_stream.go
- func (c *Control
Client ) Notifications( ctx context.Context , ) iter.Seq2[ControlNotification , error] -
- Errors
- Malformed or unknown notifications yield their error and iteration continues. Every other error ends the stream after being yielded, including the
ErrControlStreamLostoros.ErrClosederrorControlClient.NextNotificationreports at a natural end, both of which matchErrControlClosed.doc comment · control_stream.go:97
Description
It is
ControlClient.NextNotificationas a range loop. Reads from several iterators or direct calls are serialized, so a notification reaches one of them rather than all.for notification, err := range client.Notifications(ctx) {if err != nil {return err}if pane, output, ok := notification.Output(); ok {handle(pane, output)}}Malformed or unknown notifications yield their error and iteration continues. Every other error ends the stream after being yielded, including the
ErrControlStreamLostoros.ErrClosederrorControlClient.NextNotificationreports at a natural end, both of which matchErrControlClosed.Leaving early preserves queued notifications for the next read.
- Parameters
Recorded calls
source callsThe Go reference records declarations, not calls, so this page shows no callers or callees. That is a limit of the extracted data, not a statement that nothing calls tmux.ControlClient.Notifications.