Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-06-15 10:30:05 +01:00
6 changed files with 44 additions and 6 deletions

View File

@@ -38,9 +38,10 @@ const struct cmd_entry cmd_new_pane_entry = {
.name = "new-pane",
.alias = "newp",
.args = { "bc:de:EfF:hIkl:Lm:p:PR:s:S:t:T:vWx:X:y:Y:Z", 0, -1, NULL },
.usage = "[-bdefhIklPvWZ] [-c start-directory] [-e environment] "
"[-F format] [-l size] [-m message] [-p percentage] "
.args = { "bB:c:de:EfF:hIkl:Lm:p:PR:s:S:t:T:vWx:X:y:Y:Z", 0, -1, NULL },
.usage = "[-bdefhIklPvWZ] [-B border-lines] "
"[-c start-directory] [-e environment] "
"[-F format] [-l size] [-m message] [-p percentage] "
"[-s style] [-S active-border-style] "
"[-R inactive-border-style] [-T title] [-x width] [-y height] "
"[-X x-position] [-Y y-position] " CMD_TARGET_PANE_USAGE " "
@@ -84,9 +85,11 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
struct layout_cell *lc = NULL;
struct cmd_find_state fs;
int input, empty, is_floating, flags = 0;
const char *template, *style;
const char *template, *style, *value;
char *cause = NULL, *cp, *title;
struct options_entry *oe;
struct args_value *av;
enum pane_lines lines;
u_int count = args_count(args);
if (cmd_get_entry(self) == &cmd_new_pane_entry)
@@ -187,6 +190,19 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
return (CMD_RETURN_ERROR);
}
}
value = args_get(args, 'B');
if (value != NULL) {
oe = options_get(new_wp->options, "pane-border-lines");
lines = options_find_choice(options_table_entry(oe), value,
&cause);
if (cause != NULL) {
cmdq_error(item, "pane-border-lines %s", cause);
free(cause);
return (CMD_RETURN_ERROR);
}
options_set_number(new_wp->options, "pane-border-lines",
lines);
}
if (args_has(args, 'k') || args_has(args, 'm')) {
options_set_number(new_wp->options, "remain-on-exit", 3);
if (args_has(args, 'm')) {

View File

@@ -1364,7 +1364,7 @@ const struct options_table_entry options_table[] = {
{ .name = "pane-border-lines",
.type = OPTIONS_TABLE_CHOICE,
.scope = OPTIONS_TABLE_WINDOW,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
.choices = options_table_pane_border_lines_list,
.default_num = PANE_LINES_SINGLE,
.text = "Type of characters used to draw pane border lines. Some of "

View File

@@ -1003,6 +1003,7 @@ screen_redraw_draw_borders_cell(struct screen_redraw_ctx *ctx, u_int i, u_int j)
struct format_tree *ft;
struct window_pane *wp, *active = server_client_get_pane(c);
struct grid_cell gc;
enum pane_lines pane_lines;
u_int cell_type;
u_int x = ctx->ox + i, y = ctx->oy + j;
int isolates;
@@ -1034,7 +1035,11 @@ screen_redraw_draw_borders_cell(struct screen_redraw_ctx *ctx, u_int i, u_int j)
screen_redraw_check_is(ctx, x, y, marked_pane.wp))
gc.attr ^= GRID_ATTR_REVERSE;
}
screen_redraw_border_set(w, wp, ctx->pane_lines, cell_type, &gc);
if (wp == NULL)
pane_lines = ctx->pane_lines;
else
pane_lines = window_pane_get_pane_lines(wp);
screen_redraw_border_set(w, wp, pane_lines, cell_type, &gc);
if (cell_type == CELL_TOPBOTTOM &&
(c->flags & CLIENT_UTF8) &&

4
tmux.1
View File

@@ -3492,6 +3492,7 @@ but a different format may be specified with
.Tg newp
.It Xo Ic new\-pane
.Op Fl bdefhIkPvWZ
.Op Fl B Ar border\-lines
.Op Fl c Ar start\-directory
.Op Fl e Ar environment
.Op Fl F Ar format
@@ -3523,6 +3524,9 @@ sets the border style when the pane is inactive (see
.Sx STYLES ) .
.Fl T
sets the pane title.
.Fl B
sets the pane border lines for floating panes; see
.Ic pane\-border\-lines .
.Pp
.Fl h
does a horizontal split and

1
tmux.h
View File

@@ -3523,6 +3523,7 @@ int window_pane_get_bg_control_client(struct window_pane *);
int window_get_bg_client(struct window_pane *);
enum client_theme window_pane_get_theme(struct window_pane *);
void window_pane_send_theme_update(struct window_pane *);
enum pane_lines window_pane_get_pane_lines(struct window_pane *);
int window_get_pane_status(struct window *);
int window_pane_get_pane_status(struct window_pane *);
struct style_range *window_pane_status_get_range(struct window_pane *, u_int,

View File

@@ -2159,6 +2159,18 @@ window_pane_status_get_range(struct window_pane *wp, u_int x, u_int y)
return (style_ranges_get_range(srs, x - wp->xoff - 2));
}
enum pane_lines
window_pane_get_pane_lines(struct window_pane *wp)
{
struct options *oo;
if (!window_pane_is_floating(wp))
oo = wp->window->options;
else
oo = wp->options;
return (options_get_number(oo, "pane-border-lines"));
}
int
window_get_pane_status(struct window *w)
{