mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Add client-detached notification in control mode, from Mohsin Kaleem.
This commit is contained in:
parent
9017af2355
commit
8b800b41c9
@ -171,6 +171,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
|
void
|
||||||
control_notify_session_renamed(struct session *s)
|
control_notify_session_renamed(struct session *s)
|
||||||
{
|
{
|
||||||
|
2
notify.c
2
notify.c
@ -126,6 +126,8 @@ notify_callback(struct cmdq_item *item, void *data)
|
|||||||
control_notify_window_renamed(ne->window);
|
control_notify_window_renamed(ne->window);
|
||||||
if (strcmp(ne->name, "client-session-changed") == 0)
|
if (strcmp(ne->name, "client-session-changed") == 0)
|
||||||
control_notify_client_session_changed(ne->client);
|
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)
|
if (strcmp(ne->name, "session-renamed") == 0)
|
||||||
control_notify_session_renamed(ne->session);
|
control_notify_session_renamed(ne->session);
|
||||||
if (strcmp(ne->name, "session-created") == 0)
|
if (strcmp(ne->name, "session-created") == 0)
|
||||||
|
2
tmux.1
2
tmux.1
@ -6107,6 +6107,8 @@ A notification will never occur inside an output block.
|
|||||||
.Pp
|
.Pp
|
||||||
The following notifications are defined:
|
The following notifications are defined:
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
|
.It Ic %client-detached Ar client
|
||||||
|
The client has detached.
|
||||||
.It Ic %client-session-changed Ar client session-id name
|
.It Ic %client-session-changed Ar client session-id name
|
||||||
The client is now attached to the session with ID
|
The client is now attached to the session with ID
|
||||||
.Ar session-id ,
|
.Ar session-id ,
|
||||||
|
1
tmux.h
1
tmux.h
@ -2945,6 +2945,7 @@ void control_notify_window_unlinked(struct session *, struct window *);
|
|||||||
void control_notify_window_linked(struct session *, struct window *);
|
void control_notify_window_linked(struct session *, struct window *);
|
||||||
void control_notify_window_renamed(struct window *);
|
void control_notify_window_renamed(struct window *);
|
||||||
void control_notify_client_session_changed(struct client *);
|
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_renamed(struct session *);
|
||||||
void control_notify_session_created(struct session *);
|
void control_notify_session_created(struct session *);
|
||||||
void control_notify_session_closed(struct session *);
|
void control_notify_session_closed(struct session *);
|
||||||
|
Loading…
Reference in New Issue
Block a user