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

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>
@@ -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,