Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'

* refs/remotes/tmux-openbsd/master:
  Respect the ncv capability and do not combine attributes and colours that will not work, reported by Joan Bruguera Micó in GitHub issue 5727.
  Clear implied Meta when discarding BackTab modifiers, GitHub issue 5730 from Joan Fabrégat.
  Do not treat compact padding cells as width 1, make them width 0. GitHub issue 5718 from dustgle at gmail dot com.
  Do not reuse old session group names when a new session is the same as its original session, GitHub issue 5704.
This commit is contained in:
tmux update bot
2026-10-12 11:40:06 +00:00
6 changed files with 56 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: cmd-new-session.c,v 1.153 2026/10/09 13:12:14 nicm Exp $ */ /* $OpenBSD: cmd-new-session.c,v 1.154 2026/10/12 07:52:05 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -82,7 +82,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
char *cause, *cwd = NULL, *cp, *ename; char *cause, *cwd = NULL, *cp, *ename;
char *wname = NULL, *sname = NULL, *prefix = NULL; char *wname = NULL, *sname = NULL, *prefix = NULL;
int detached, already_attached, is_control = 0; int detached, already_attached, is_control = 0;
u_int sx, sy, dsx, dsy, count = args_count(args); u_int sx, sy, dsx, dsy, idx;
u_int count = args_count(args);
struct spawn_context sc = { 0 }; struct spawn_context sc = { 0 };
enum cmd_retval retval; enum cmd_retval retval;
struct cmd_find_state fs; struct cmd_find_state fs;
@@ -316,12 +317,17 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
* so add it to the group and synchronize. * so add it to the group and synchronize.
*/ */
if (group != NULL) { if (group != NULL) {
if (sg == NULL) { if (sg == NULL && groupwith == NULL)
if (groupwith != NULL) { sg = session_group_new(group);
sg = session_group_new(groupwith->name); else if (sg == NULL) {
session_group_add(sg, groupwith); cp = xstrdup(groupwith->name);
} else for (idx = 1; session_group_find(cp) != NULL; idx++) {
sg = session_group_new(group); free(cp);
xasprintf(&cp, "%s-%u", groupwith->name, idx);
}
sg = session_group_new(cp);
free(cp);
session_group_add(sg, groupwith);
} }
session_group_add(sg, s); session_group_add(sg, s);
session_group_synchronize_to(s); session_group_synchronize_to(s);

9
grid.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: grid.c,v 1.159 2026/10/08 07:50:05 nicm Exp $ */ /* $OpenBSD: grid.c,v 1.160 2026/10/12 08:08:37 nicm Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -45,7 +45,7 @@ const struct grid_cell grid_default_cell = {
/* /*
* Padding grid cell data. Padding cells are the only zero width cell that * Padding grid cell data. Padding cells are the only zero width cell that
* appears in the grid - because of this, they are always extended cells. * appears in the grid.
*/ */
static const struct grid_cell grid_padding_cell = { static const struct grid_cell grid_padding_cell = {
{ { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 8, 0 { { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 8, 0
@@ -642,7 +642,10 @@ grid_get_cell1(struct grid_line *gl, u_int px, struct grid_cell *gc)
if (gce->flags & GRID_FLAG_BG256) if (gce->flags & GRID_FLAG_BG256)
gc->bg |= COLOUR_FLAG_256; gc->bg |= COLOUR_FLAG_256;
gc->us = 8; gc->us = 8;
utf8_set(&gc->data, gce->data.data); if (gc->flags & GRID_FLAG_PADDING)
memcpy(&gc->data, &grid_padding_cell.data, sizeof gc->data);
else
utf8_set(&gc->data, gce->data.data);
gc->link = 0; gc->link = 0;
} }

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: input-keys.c,v 1.114 2026/06/15 21:47:01 nicm Exp $ */ /* $OpenBSD: input-keys.c,v 1.115 2026/10/12 09:37:07 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -620,7 +620,7 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT; key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT;
} else { } else {
/* Otherwise clear modifiers. */ /* Otherwise clear modifiers. */
key &= ~KEYC_MASK_MODIFIERS; key &= ~(KEYC_MASK_MODIFIERS|KEYC_IMPLIED_META);
} }
} }

3
tmux.h
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tmux.h,v 1.1455 2026/10/09 13:12:14 nicm Exp $ */ /* $OpenBSD: tmux.h,v 1.1456 2026/10/12 10:39:05 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -638,6 +638,7 @@ enum tty_code_code {
TTYC_KUP6, TTYC_KUP6,
TTYC_KUP7, TTYC_KUP7,
TTYC_MS, TTYC_MS,
TTYC_NCV,
TTYC_NOBR, TTYC_NOBR,
TTYC_OL, TTYC_OL,
TTYC_OP, TTYC_OP,

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty-term.c,v 1.111 2026/09/22 14:10:26 nicm Exp $ */ /* $OpenBSD: tty-term.c,v 1.112 2026/10/12 10:39:05 nicm Exp $ */
/* /*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -254,6 +254,7 @@ static const struct tty_term_code_entry tty_term_codes[] = {
[TTYC_KUP6] = { TTYCODE_STRING, "kUP6" }, [TTYC_KUP6] = { TTYCODE_STRING, "kUP6" },
[TTYC_KUP7] = { TTYCODE_STRING, "kUP7" }, [TTYC_KUP7] = { TTYCODE_STRING, "kUP7" },
[TTYC_MS] = { TTYCODE_STRING, "Ms" }, [TTYC_MS] = { TTYCODE_STRING, "Ms" },
[TTYC_NCV] = { TTYCODE_NUMBER, "ncv" },
[TTYC_NOBR] = { TTYCODE_STRING, "Nobr" }, [TTYC_NOBR] = { TTYCODE_STRING, "Nobr" },
[TTYC_OL] = { TTYCODE_STRING, "ol" }, [TTYC_OL] = { TTYCODE_STRING, "ol" },
[TTYC_OP] = { TTYCODE_STRING, "op" }, [TTYC_OP] = { TTYCODE_STRING, "op" },

31
tty.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tty.c,v 1.485 2026/10/07 07:34:59 nicm Exp $ */ /* $OpenBSD: tty.c,v 1.486 2026/10/12 10:39:05 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -51,6 +51,7 @@ static void tty_check_bg(struct tty *, struct colour_palette *,
struct grid_cell *); struct grid_cell *);
static void tty_check_us(struct tty *, struct colour_palette *, static void tty_check_us(struct tty *, struct colour_palette *,
struct grid_cell *); struct grid_cell *);
static void tty_check_ncv(struct tty *, struct grid_cell *);
static int tty_map_theme_colour(struct tty *, int); static int tty_map_theme_colour(struct tty *, int);
static void tty_colours_fg(struct tty *, const struct grid_cell *); static void tty_colours_fg(struct tty *, const struct grid_cell *);
static void tty_colours_bg(struct tty *, const struct grid_cell *); static void tty_colours_bg(struct tty *, const struct grid_cell *);
@@ -2474,6 +2475,33 @@ tty_dim_default_colour(struct tty *tty, int c, int foreground)
return (c); return (c);
} }
static void
tty_check_ncv(struct tty *tty, struct grid_cell *gc)
{
int n;
if (COLOUR_DEFAULT(gc->fg) && COLOUR_DEFAULT(gc->bg))
return;
n = tty_term_number(tty->term, TTYC_NCV);
if (n & 2)
gc->attr &= ~GRID_ATTR_ALL_UNDERSCORE;
if (n & 4)
gc->attr &= ~GRID_ATTR_REVERSE;
if (n & 8)
gc->attr &= ~GRID_ATTR_BLINK;
if (n & 16)
gc->attr &= ~GRID_ATTR_DIM;
if (n & 32)
gc->attr &= ~GRID_ATTR_BRIGHT;
if (n & 64)
gc->attr &= ~GRID_ATTR_HIDDEN;
if (n & 256)
gc->attr &= ~GRID_ATTR_CHARSET;
if (n & 32768)
gc->attr &= ~GRID_ATTR_ITALICS;
}
void void
tty_attributes(struct tty *tty, const struct grid_cell *gc, tty_attributes(struct tty *tty, const struct grid_cell *gc,
const struct tty_style_ctx *style_ctx) const struct tty_style_ctx *style_ctx)
@@ -2544,6 +2572,7 @@ tty_attributes(struct tty *tty, const struct grid_cell *gc,
tty_check_fg(tty, palette, &gc2); tty_check_fg(tty, palette, &gc2);
tty_check_bg(tty, palette, &gc2); tty_check_bg(tty, palette, &gc2);
tty_check_us(tty, palette, &gc2); tty_check_us(tty, palette, &gc2);
tty_check_ncv(tty, &gc2);
/* /*
* If any bits are being cleared or the underline colour is now default, * If any bits are being cleared or the underline colour is now default,