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.

interface libtmux-java latest

Notification

What a control-mode notification says, typed, for matching on.

Source and package
Qualified name
io.github.libtmux.control.Notification
Package
io.github.libtmux.control
Distribution
io.github.libtmux:libtmux
Source
libtmux/src/main/java/io/github/libtmux/control/Notification.java
interface io.github.libtmux.control.Notification

Description#

Sealed, with Unknown as the case for everything else. tmux adds notifications between releases, and a closed set with nowhere to put a new one would drop it; here a notification this library does not model yet still arrives, as Unknown, and ControlEvent#kind() and ControlEvent#fields() still carry what tmux wrote.

The forms are tmux's own, from control-notify.c. A name — of a window, a session, a client — is everything after the id, spaces included, as tmux writes it.

Examples#

switch (event.notification()) {
case Notification.WindowRenamed(WindowId window, String name, boolean attached) -> relabel(window, name);
case Notification.SessionsChanged changed -> refreshSessions();
default -> {}
}

Members22#

  • ClientDetached class %client-detached: a client detached.
  • ClientSessionChanged class %client-session-changed: another client is now attached to this session.
  • ConfigError class %config-error: a configuration file tmux loaded for this client had an error. tmux 3.4 and later.
  • Continue class %continue: a paused pane's output flows to this client again.
  • Exit class %exit: the client is exiting, with tmux's reason when it gave one.
  • LayoutChanged class %layout-change: a window's layout changed, in whichever form tmux reports it.
  • Message class %message: text another client showed on this one with display-message -c. tmux 3.4 and later.
  • PaneModeChanged class %pane-mode-changed: a pane entered or left a mode.
  • PasteBufferChanged class %paste-buffer-changed: a paste buffer was created or changed.
  • PasteBufferDeleted class %paste-buffer-deleted: a paste buffer was deleted.
  • Pause class %pause: tmux stopped sending a pane's output to this client, which turned flow control on with refresh-client -f pause-after=N and fell N seconds behind. refresh-client -A '%1:continue' resumes it.
  • read method Reads one notification from its kind and the text after it.
  • SessionChanged class %session-changed: the attached client is now attached to this session.
  • SessionRenamed class %session-renamed: a session has a new name.
  • SessionsChanged class %sessions-changed: a session was created or destroyed.
  • SessionWindowChanged class %session-window-changed: a session's current window changed.
  • SubscriptionChanged class %subscription-changed: a watched format has a new value.
  • Unknown class A notification this library does not model; ControlEvent still carries all of it.
  • WindowAdded class %window-add: a window was created; attached is false for unlinked-window-add.
  • WindowClosed class %window-close: a window was destroyed; attached as for WindowAdded.
  • WindowPaneChanged class %window-pane-changed: a window's active pane changed.
  • WindowRenamed class %window-renamed: a window has a new name; attached as for WindowAdded.
Esc

Type to search.

Reference previewOpen reference