Add a client-active hook, from ncfavier in GitHub issue 2803.

pull/2807/head
nicm 2021-08-04 08:07:19 +00:00
parent e37aa45681
commit 42490f4750
3 changed files with 5 additions and 0 deletions

View File

@ -1145,6 +1145,7 @@ const struct options_table_entry options_table[] = {
OPTIONS_TABLE_HOOK("alert-activity", ""),
OPTIONS_TABLE_HOOK("alert-bell", ""),
OPTIONS_TABLE_HOOK("alert-silence", ""),
OPTIONS_TABLE_HOOK("client-active", ""),
OPTIONS_TABLE_HOOK("client-attached", ""),
OPTIONS_TABLE_HOOK("client-detached", ""),
OPTIONS_TABLE_HOOK("client-resized", ""),

View File

@ -1127,6 +1127,8 @@ server_client_update_latest(struct client *c)
if (options_get_number(w->options, "window-size") == WINDOW_SIZE_LATEST)
recalculate_size(w, 0);
notify_client("client-active", c);
}
/*

2
tmux.1
View File

@ -4396,6 +4396,8 @@ See
Run when a window has been silent.
See
.Ic monitor-silence .
.It client-active
Run when a client becomes the latest active client of its session.
.It client-attached
Run when a client is attached.
.It client-detached