summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-03-16 10:01:20 +0000
committerThomas Adam <thomas@xteddy.org>2021-03-16 10:01:20 +0000
commitbe568ea3b21b88763d2cc274bdec3a476136de2f (patch)
tree01be0e4734b3c14554060d6429ad2911a2942f99
parent60bb8fa86d040c671cc9f8e4df788b3b7116d8b3 (diff)
parent8b800b41c98c37a270cea61e57d1f2702fd75293 (diff)
Merge branch 'obsd-master' into master
-rw-r--r--control-notify.c11
-rw-r--r--notify.c2
-rw-r--r--tmux.12
-rw-r--r--tmux.h1
4 files changed, 16 insertions, 0 deletions
diff --git a/control-notify.c b/control-notify.c
index cc706ac2..6ff0e436 100644
--- a/control-notify.c
+++ b/control-notify.c
@@ -172,6 +172,17 @@ control_notify_client_session_changed(struct client *cc)
}
void
+control_notify_client_detached(struct client *cc)
+{
+ struct client *c;
+
+ TAILQ_FOREACH(c, &clients, entry) {
+ if (CONTROL_SHOULD_NOTIFY_CLIENT(c))
+ control_write(c, "%%client-detached %s", cc->name);
+ }
+}
+
+void
control_notify_session_renamed(struct session *s)
{
struct client *c;
diff --git a/notify.c b/notify.c
index f7440cad..4b9b1eaa 100644
--- a/notify.c
+++ b/notify.c
@@ -125,6 +125,8 @@ notify_callback(struct cmdq_item *item, void *data)
control_notify_window_renamed(ne->window);
if (strcmp(ne->name, "client-session-changed") == 0)
control_notify_client_session_changed(ne->client);
+ if (strcmp(ne->name, "client-detached") == 0)
+ control_notify_client_detached(ne->client);
if (strcmp(ne->name, "session-renamed") == 0)
control_notify_session_renamed(ne->session);
if (strcmp(ne->name, "session-created") == 0)
diff --git a/tmux.1 b/tmux.1
index c79950ce..7bfcb5aa 100644
--- a/tmux.1
+++ b/tmux.1
@@ -6107,6 +6107,8 @@ A notification will never occur inside an output block.
.Pp
The following notifications are defined:
.Bl -tag -width Ds
+.It Ic %client-detached Ar client
+The client has detached.
.It Ic %client-session-changed Ar client session-id name
The client is now attached to the session with ID
.Ar session-id ,
diff --git a/tmux.h b/tmux.h
index ca71559f..fbc78d2f 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2946,6 +2946,7 @@ void control_notify_window_unlinked(struct session *, struct window *);
void control_notify_window_linked(struct session *, struct window *);
void control_notify_window_renamed(struct window *);
void control_notify_client_session_changed(struct client *);
+void control_notify_client_detached(struct client *);
void control_notify_session_renamed(struct session *);
void control_notify_session_created(struct session *);
void control_notify_session_closed(struct session *);