From 12c93f50f06db6c6c7e1bd92d5c509cbc6e96751 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 12 Oct 2026 07:52:05 +0000 Subject: [PATCH 1/4] Do not reuse old session group names when a new session is the same as its original session, GitHub issue 5704. --- cmd-new-session.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/cmd-new-session.c b/cmd-new-session.c index 7f7643bfe..83a027de9 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -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 @@ -82,7 +82,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) char *cause, *cwd = NULL, *cp, *ename; char *wname = NULL, *sname = NULL, *prefix = NULL; 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 }; enum cmd_retval retval; 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. */ if (group != NULL) { - if (sg == NULL) { - if (groupwith != NULL) { - sg = session_group_new(groupwith->name); - session_group_add(sg, groupwith); - } else - sg = session_group_new(group); + if (sg == NULL && groupwith == NULL) + sg = session_group_new(group); + else if (sg == NULL) { + cp = xstrdup(groupwith->name); + for (idx = 1; session_group_find(cp) != NULL; idx++) { + 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_synchronize_to(s); From ef52b9e1cbdba16b673db75f8c73cfed7b307a28 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 12 Oct 2026 08:08:37 +0000 Subject: [PATCH 2/4] Do not treat compact padding cells as width 1, make them width 0. GitHub issue 5718 from dustgle at gmail dot com. --- grid.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/grid.c b/grid.c index 19d1054ef..8af37d83d 100644 --- a/grid.c +++ b/grid.c @@ -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 @@ -42,7 +42,7 @@ const struct grid_cell grid_default_cell = { /* * 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 = { { { '!' }, 0, 0, 0 }, 0, GRID_FLAG_PADDING, 8, 8, 8, 0 @@ -591,7 +591,10 @@ grid_get_cell1(struct grid_line *gl, u_int px, struct grid_cell *gc) if (gce->flags & GRID_FLAG_BG256) gc->bg |= COLOUR_FLAG_256; 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; } From 8ba04e721c3141a2eb686ed24f6c8813808fb9e8 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 12 Oct 2026 09:37:07 +0000 Subject: [PATCH 3/4] =?UTF-8?q?Clear=20implied=20Meta=20when=20discarding?= =?UTF-8?q?=20BackTab=20modifiers,=20GitHub=20issue=205730=20from=20Joan?= =?UTF-8?q?=20Fabr=C3=A9gat.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- input-keys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input-keys.c b/input-keys.c index 3208a33c3..ee1e3aa87 100644 --- a/input-keys.c +++ b/input-keys.c @@ -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 @@ -621,7 +621,7 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key) key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT; } else { /* Otherwise clear modifiers. */ - key &= ~KEYC_MASK_MODIFIERS; + key &= ~(KEYC_MASK_MODIFIERS|KEYC_IMPLIED_META); } } From 801703a3ac85bc7738c6d48b791be82359707090 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 12 Oct 2026 10:39:05 +0000 Subject: [PATCH 4/4] =?UTF-8?q?Respect=20the=20ncv=20capability=20and=20do?= =?UTF-8?q?=20not=20combine=20attributes=20and=20colours=20that=20will=20n?= =?UTF-8?q?ot=20work,=20reported=20by=20Joan=20Bruguera=20Mic=C3=B3=20in?= =?UTF-8?q?=20GitHub=20issue=205727.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmux.h | 3 ++- tty-term.c | 3 ++- tty.c | 31 ++++++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/tmux.h b/tmux.h index fdea4145a..65bd00761 100644 --- a/tmux.h +++ b/tmux.h @@ -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 @@ -629,6 +629,7 @@ enum tty_code_code { TTYC_KUP6, TTYC_KUP7, TTYC_MS, + TTYC_NCV, TTYC_NOBR, TTYC_OL, TTYC_OP, diff --git a/tty-term.c b/tty-term.c index f2d8b67b6..e34a872b4 100644 --- a/tty-term.c +++ b/tty-term.c @@ -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 @@ -251,6 +251,7 @@ static const struct tty_term_code_entry tty_term_codes[] = { [TTYC_KUP6] = { TTYCODE_STRING, "kUP6" }, [TTYC_KUP7] = { TTYCODE_STRING, "kUP7" }, [TTYC_MS] = { TTYCODE_STRING, "Ms" }, + [TTYC_NCV] = { TTYCODE_NUMBER, "ncv" }, [TTYC_NOBR] = { TTYCODE_STRING, "Nobr" }, [TTYC_OL] = { TTYCODE_STRING, "ol" }, [TTYC_OP] = { TTYCODE_STRING, "op" }, diff --git a/tty.c b/tty.c index 161747655..ad2853d42 100644 --- a/tty.c +++ b/tty.c @@ -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 @@ -51,6 +51,7 @@ static void tty_check_bg(struct tty *, struct colour_palette *, struct grid_cell *); static void tty_check_us(struct tty *, struct colour_palette *, struct grid_cell *); +static void tty_check_ncv(struct tty *, struct grid_cell *); static int tty_map_theme_colour(struct tty *, int); static void tty_colours_fg(struct tty *, const struct grid_cell *); static void tty_colours_bg(struct tty *, const struct grid_cell *); @@ -2350,6 +2351,33 @@ tty_dim_default_colour(struct tty *tty, int c, int foreground) 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 tty_attributes(struct tty *tty, const struct grid_cell *gc, const struct tty_style_ctx *style_ctx) @@ -2420,6 +2448,7 @@ tty_attributes(struct tty *tty, const struct grid_cell *gc, tty_check_fg(tty, palette, &gc2); tty_check_bg(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,