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); diff --git a/grid.c b/grid.c index 28a82cb2c..e7f9ab7c6 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 @@ -45,7 +45,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 @@ -642,7 +642,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; } diff --git a/input-keys.c b/input-keys.c index 4cade4e53..aa2b8abbb 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 @@ -620,7 +620,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); } } diff --git a/tmux.h b/tmux.h index 017a05890..5b6ef46cd 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 @@ -638,6 +638,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 1ac078cd4..3311701ba 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 @@ -254,6 +254,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 02ced9fdd..817d46ff8 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 *); @@ -2474,6 +2475,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) @@ -2544,6 +2572,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,