diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-03-02 12:08:34 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-03-02 12:08:34 +0000 |
commit | c01251d02388efceca515c47c257e2b5342e3716 (patch) | |
tree | ca89407cb43bd2caa40a6854ba49ce1720e892ce /cmd-set-option.c | |
parent | 5c275c2a1a963876d4ac392067e42120417dbf43 (diff) | |
parent | 1466b570eedda0423d5a386d2b16b7ff0c0e477c (diff) | |
download | rtmux-c01251d02388efceca515c47c257e2b5342e3716.tar.gz rtmux-c01251d02388efceca515c47c257e2b5342e3716.tar.bz2 rtmux-c01251d02388efceca515c47c257e2b5342e3716.zip |
Merge branch 'master' into 3.2-rc
Diffstat (limited to 'cmd-set-option.c')
-rw-r--r-- | cmd-set-option.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/cmd-set-option.c b/cmd-set-option.c index 0df12aa0..70e3c54d 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -33,8 +33,8 @@ const struct cmd_entry cmd_set_option_entry = { .name = "set-option", .alias = "set", - .args = { "aFgopqst:uw", 1, 2 }, - .usage = "[-aFgopqsuw] " CMD_TARGET_PANE_USAGE " option [value]", + .args = { "aFgopqst:uUw", 1, 2 }, + .usage = "[-aFgopqsuUw] " CMD_TARGET_PANE_USAGE " option [value]", .target = { 't', CMD_FIND_PANE, CMD_FIND_CANFAIL }, @@ -74,8 +74,9 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item) struct args *args = cmd_get_args(self); int append = args_has(args, 'a'); struct cmd_find_state *target = cmdq_get_target(item); + struct window_pane *loop; struct options *oo; - struct options_entry *parent, *o; + struct options_entry *parent, *o, *po; char *name, *argument, *value = NULL, *cause; int window, idx, already, error, ambiguous; int scope; @@ -148,7 +149,19 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item) } /* Change the option. */ - if (args_has(args, 'u')) { + if (args_has(args, 'U') && scope == OPTIONS_TABLE_WINDOW) { + TAILQ_FOREACH(loop, &target->w->panes, entry) { + po = options_get_only(loop->options, name); + if (po == NULL) + continue; + if (options_remove_or_default(po, idx, &cause) != 0) { + cmdq_error(item, "%s", cause); + free(cause); + goto fail; + } + } + } + if (args_has(args, 'u') || args_has(args, 'U')) { if (o == NULL) goto out; if (options_remove_or_default(o, idx, &cause) != 0) { |