# 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/5f808882015a975a65acc7f9da5b3ff0d5cbdc91/tmux/control_stream.go#L58
- **Page:** https://libtmux.org/reference/go/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.

Natural tmux exit drains queued notifications and then ends without error.

Leaving early preserves queued notifications for the next read.
