# tmux.ControlClient.Notifications

- **Module:** tmux.ControlClient
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/control_stream.go#L89
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-controlclient-notifications/

```
tmux.ControlClient.Notifications(ctx: context.Context) -> iter.Seq2[ControlNotification, error]
```

Notifications returns an iterator over what tmux says without being asked: pane output, and the events behind [ControlNotification].

It is [ControlClient.NextNotification] as a range loop; exactly one iterator
or direct notification read may run at a time.

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
[ErrControlStreamLost] or os.ErrClosed [ControlClient.NextNotification]
reports at a natural end.

Leaving early preserves queued notifications for the next read.
