add -R to be able to set floating pane inactive border style.

This commit is contained in:
Michael Grant
2026-03-24 18:15:24 +00:00
parent 75ed7b27c6
commit c10a597bf0
2 changed files with 20 additions and 10 deletions

View File

@@ -35,9 +35,10 @@ const struct cmd_entry cmd_new_pane_entry = {
.name = "new-pane", .name = "new-pane",
.alias = "newp", .alias = "newp",
.args = { "bc:de:fF:h:Iklm:p:Ps:S:t:w:x:y:Z", 0, -1, NULL }, .args = { "bc:de:fF:h:Iklm:p:PR:s:S:t:w:x:y:Z", 0, -1, NULL },
.usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] " .usage = "[-bdefhIklPvZ] [-c start-directory] [-e environment] "
"[-F format] [-l size] [-m message] [-s style] [-S border-style] " "[-F format] [-l size] [-m message] "
"[-R inactive-border-style] [-s style] [-S active-border-style] "
CMD_TARGET_PANE_USAGE " [shell-command [argument ...]]", CMD_TARGET_PANE_USAGE " [shell-command [argument ...]]",
.target = { 't', CMD_FIND_PANE, 0 }, .target = { 't', CMD_FIND_PANE, 0 },
@@ -217,13 +218,19 @@ cmd_new_pane_exec(struct cmd *self, struct cmdq_item *item)
} }
style = args_get(args, 'S'); style = args_get(args, 'S');
if (style != NULL) { if (style != NULL) {
if (options_set_string(new_wp->options, "pane-border-style", 0, if (options_set_string(new_wp->options,
"%s", style) == NULL) { "pane-active-border-style", 0, "%s", style) == NULL) {
cmdq_error(item, "bad border style: %s", style); cmdq_error(item, "bad active border style: %s", style);
return (CMD_RETURN_ERROR);
}
}
style = args_get(args, 'R');
if (style != NULL) {
if (options_set_string(new_wp->options, "pane-border-style", 0,
"%s", style) == NULL) {
cmdq_error(item, "bad inactive border style: %s", style);
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
options_set_string(new_wp->options, "pane-active-border-style",
0, "%s", style);
} }
if (args_has(args, 'k') || args_has(args, 'm')) { if (args_has(args, 'k') || args_has(args, 'm')) {
options_set_number(new_wp->options, "remain-on-exit", 3); options_set_number(new_wp->options, "remain-on-exit", 3);

9
tmux.1
View File

@@ -3278,8 +3278,9 @@ but a different format may be specified with
.Op Fl l Ar size .Op Fl l Ar size
.Op Fl m Ar message .Op Fl m Ar message
.Op Fl p Ar percentage .Op Fl p Ar percentage
.Op Fl R Ar inactive-border-style
.Op Fl s Ar style .Op Fl s Ar style
.Op Fl S Ar border-style .Op Fl S Ar active-border-style
.Op Fl t Ar target-pane .Op Fl t Ar target-pane
.Op Fl w Ar width .Op Fl w Ar width
.Op Fl x Ar x-position .Op Fl x Ar x-position
@@ -3337,9 +3338,11 @@ is not specified or empty)
will create an empty pane and forward any output from stdin to it. will create an empty pane and forward any output from stdin to it.
.Pp .Pp
.Fl s .Fl s
sets the style for the pane and sets the style for the pane content.
.Fl S .Fl S
sets the style for the pane border (see sets the border style when the pane is active and
.Fl R
sets the border style when the pane is inactive (see
.Sx STYLES ) . .Sx STYLES ) .
.Pp .Pp
All other options have the same meaning as for the All other options have the same meaning as for the