Core Library0.xAPI reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

MoreLess about this notice
View Columns are a trial view; the tree stays the default. All variantsPanels

method libtmux-go

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.ControlClient.Notifications
Package
tmux
Declared in
ControlClient
Distribution
github.com/libtmux/libtmux-go/tmux
Source
tmux/control_stream.go
Errors
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 error ControlClient.NextNotification reports at a natural end, both of which match ErrControlClosed.doc comment · control_stream.go:97

Description

It is ControlClient.NextNotification as 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 ErrControlStreamLost or os.ErrClosed error ControlClient.NextNotification reports at a natural end, both of which match ErrControlClosed.

Leaving early preserves queued notifications for the next read.

Parameters

Recorded calls

source calls
No call edges in the Go model.

The 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.

Esc
Search in

Type to search.

Reference previewOpen reference