mirror of
https://github.com/tmux/tmux.git
synced 2026-10-13 06:04:34 +00:00
Merge branch 'master' into 4902-image-support
# Conflicts: # Makefile.am # configure.ac # format.c # image-sixel.c # regress/tty-keys-replies.sh # resize.c # screen-redraw.c # screen-write.c # screen.c # tmux.1 # tmux.h # tty-features.c # tty.c
This commit is contained in:
31
tty.c
31
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 <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 *);
|
||||
@@ -2425,6 +2426,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)
|
||||
@@ -2495,6 +2523,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,
|
||||
|
||||
Reference in New Issue
Block a user