summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2021-08-04 08:07:19 +0000
committernicm <nicm>2021-08-04 08:07:19 +0000
commit42490f4750bb6f39c08908e8e7a3b85022a077af (patch)
treeef43e265d151e58384f22a639f7198e2e3ad044a
parente37aa45681acf15a98de1940901d7e368dbbf33b (diff)
Add a client-active hook, from ncfavier in GitHub issue 2803.
-rw-r--r--options-table.c1
-rw-r--r--server-client.c2
-rw-r--r--tmux.12
3 files changed, 5 insertions, 0 deletions
diff --git a/options-table.c b/options-table.c
index bca529cf..a4b85fd2 100644
--- a/options-table.c
+++ b/options-table.c
@@ -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", ""),
diff --git a/server-client.c b/server-client.c
index 1be3575e..4c7def8f 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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);
}
/*
diff --git a/tmux.1 b/tmux.1
index dd25edfc..0abb4c76 100644
--- a/tmux.1
+++ b/tmux.1
@@ -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