diff options
author | nicm <nicm> | 2020-04-13 07:25:33 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-04-13 07:25:33 +0000 |
commit | 9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f (patch) | |
tree | 60971ed265c57e1bb43345b88e872181ff7ebb85 /options-table.c | |
parent | ad38ef6ff43b5794f09911c1ae72f44bb6f0869f (diff) | |
download | rtmux-9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f.tar.gz rtmux-9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f.tar.bz2 rtmux-9cbe9675ea8a8efb01dcc5f267e6d5853b2cd58f.zip |
Change so that the appropriate hooks for windows and panes belong to
pane/window options rather than all being session options. This is
useful for example to create a pane that is automatically closed on some
condition. From Anindya Mukherjee.
Diffstat (limited to 'options-table.c')
-rw-r--r-- | options-table.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/options-table.c b/options-table.c index d8612ff2..33ee4402 100644 --- a/options-table.c +++ b/options-table.c @@ -140,7 +140,7 @@ static const char *options_table_status_format_default[] = { OPTIONS_TABLE_STATUS_FORMAT1, OPTIONS_TABLE_STATUS_FORMAT2, NULL }; -/* Helper for hook options. */ +/* Helpers for hook options. */ #define OPTIONS_TABLE_HOOK(hook_name, default_value) \ { .name = hook_name, \ .type = OPTIONS_TABLE_COMMAND, \ @@ -150,6 +150,24 @@ static const char *options_table_status_format_default[] = { .separator = "" \ } +#define OPTIONS_TABLE_PANE_HOOK(hook_name, default_value) \ + { .name = hook_name, \ + .type = OPTIONS_TABLE_COMMAND, \ + .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, \ + .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \ + .default_str = default_value, \ + .separator = "" \ + } + +#define OPTIONS_TABLE_WINDOW_HOOK(hook_name, default_value) \ + { .name = hook_name, \ + .type = OPTIONS_TABLE_COMMAND, \ + .scope = OPTIONS_TABLE_WINDOW, \ + .flags = OPTIONS_TABLE_IS_ARRAY|OPTIONS_TABLE_IS_HOOK, \ + .default_str = default_value, \ + .separator = "" \ + } + /* Top-level options. */ const struct options_table_entry options_table[] = { /* Server options. */ @@ -851,21 +869,21 @@ const struct options_table_entry options_table[] = { OPTIONS_TABLE_HOOK("client-detached", ""), OPTIONS_TABLE_HOOK("client-resized", ""), OPTIONS_TABLE_HOOK("client-session-changed", ""), - OPTIONS_TABLE_HOOK("pane-died", ""), - OPTIONS_TABLE_HOOK("pane-exited", ""), - OPTIONS_TABLE_HOOK("pane-focus-in", ""), - OPTIONS_TABLE_HOOK("pane-focus-out", ""), - OPTIONS_TABLE_HOOK("pane-mode-changed", ""), - OPTIONS_TABLE_HOOK("pane-set-clipboard", ""), + OPTIONS_TABLE_PANE_HOOK("pane-died", ""), + OPTIONS_TABLE_PANE_HOOK("pane-exited", ""), + OPTIONS_TABLE_PANE_HOOK("pane-focus-in", ""), + OPTIONS_TABLE_PANE_HOOK("pane-focus-out", ""), + OPTIONS_TABLE_PANE_HOOK("pane-mode-changed", ""), + OPTIONS_TABLE_PANE_HOOK("pane-set-clipboard", ""), OPTIONS_TABLE_HOOK("session-closed", ""), OPTIONS_TABLE_HOOK("session-created", ""), OPTIONS_TABLE_HOOK("session-renamed", ""), OPTIONS_TABLE_HOOK("session-window-changed", ""), - OPTIONS_TABLE_HOOK("window-layout-changed", ""), - OPTIONS_TABLE_HOOK("window-linked", ""), - OPTIONS_TABLE_HOOK("window-pane-changed", ""), - OPTIONS_TABLE_HOOK("window-renamed", ""), - OPTIONS_TABLE_HOOK("window-unlinked", ""), + OPTIONS_TABLE_WINDOW_HOOK("window-layout-changed", ""), + OPTIONS_TABLE_WINDOW_HOOK("window-linked", ""), + OPTIONS_TABLE_WINDOW_HOOK("window-pane-changed", ""), + OPTIONS_TABLE_WINDOW_HOOK("window-renamed", ""), + OPTIONS_TABLE_WINDOW_HOOK("window-unlinked", ""), { .name = NULL } }; |