diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-07-24 07:05:38 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-07-24 07:05:38 +0000 |
commit | 3fb25c97b24aa3b863512c9d00ae75e00876e349 (patch) | |
tree | cc7bbc1fa38bf64ff441f382af90897af10140c8 /usr.bin | |
parent | 5e1ed6fcb87dfbecfe32f07523117a41aeca90bb (diff) |
Add a hook when the pane title changed.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-select-pane.c | 3 | ||||
-rw-r--r-- | usr.bin/tmux/input.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/options-table.c | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c index ae0dd43b085..3d4c8260c2e 100644 --- a/usr.bin/tmux/cmd-select-pane.c +++ b/usr.bin/tmux/cmd-select-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-pane.c,v 1.63 2020/07/03 07:00:12 nicm Exp $ */ +/* $OpenBSD: cmd-select-pane.c,v 1.64 2020/07/24 07:05:37 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -198,6 +198,7 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'T')) { title = format_single_from_target(item, args_get(args, 'T')); if (screen_set_title(&wp->base, title)) { + notify_pane("pane-title-changed", wp); server_redraw_window_borders(wp->window); server_status_window(wp->window); } diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 1238fee95d6..659a1ec84ce 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.181 2020/06/16 08:18:34 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.182 2020/07/24 07:05:37 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1867,6 +1867,7 @@ input_csi_dispatch_winops(struct input_ctx *ictx) case 2: screen_pop_title(sctx->s); if (wp != NULL) { + notify_pane("pane-title-changed", wp); server_redraw_window_borders(wp->window); server_status_window(wp->window); } @@ -2261,6 +2262,7 @@ input_exit_osc(struct input_ctx *ictx) case 0: case 2: if (screen_set_title(sctx->s, p) && wp != NULL) { + notify_pane("pane-title-changed", wp); server_redraw_window_borders(wp->window); server_status_window(wp->window); } @@ -2326,6 +2328,7 @@ input_exit_apc(struct input_ctx *ictx) log_debug("%s: \"%s\"", __func__, ictx->input_buf); if (screen_set_title(sctx->s, ictx->input_buf) && wp != NULL) { + notify_pane("pane-title-changed", wp); server_redraw_window_borders(wp->window); server_status_window(wp->window); } diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c index 11944d2cc70..b54998c3d4c 100644 --- a/usr.bin/tmux/options-table.c +++ b/usr.bin/tmux/options-table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options-table.c,v 1.132 2020/05/22 15:08:38 nicm Exp $ */ +/* $OpenBSD: options-table.c,v 1.133 2020/07/24 07:05:37 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1121,6 +1121,7 @@ const struct options_table_entry options_table[] = { OPTIONS_TABLE_PANE_HOOK("pane-focus-out", ""), OPTIONS_TABLE_PANE_HOOK("pane-mode-changed", ""), OPTIONS_TABLE_PANE_HOOK("pane-set-clipboard", ""), + OPTIONS_TABLE_PANE_HOOK("pane-title-changed", ""), OPTIONS_TABLE_HOOK("session-closed", ""), OPTIONS_TABLE_HOOK("session-created", ""), OPTIONS_TABLE_HOOK("session-renamed", ""), |