Do not downgrade styled underscores to standard underscore if the

terminal does not support them, this matches what would happen if the
application tried to use them on a terminal without support.
This commit is contained in:
nicm
2025-05-12 09:50:00 +00:00
parent 367f17a4ff
commit 7499d925da

3
tty.c
View File

@ -2634,8 +2634,7 @@ tty_attributes(struct tty *tty, const struct grid_cell *gc,
if (changed & GRID_ATTR_ITALICS) if (changed & GRID_ATTR_ITALICS)
tty_set_italics(tty); tty_set_italics(tty);
if (changed & GRID_ATTR_ALL_UNDERSCORE) { if (changed & GRID_ATTR_ALL_UNDERSCORE) {
if ((changed & GRID_ATTR_UNDERSCORE) || if (changed & GRID_ATTR_UNDERSCORE)
!tty_term_has(tty->term, TTYC_SMULX))
tty_putcode(tty, TTYC_SMUL); tty_putcode(tty, TTYC_SMUL);
else if (changed & GRID_ATTR_UNDERSCORE_2) else if (changed & GRID_ATTR_UNDERSCORE_2)
tty_putcode_i(tty, TTYC_SMULX, 2); tty_putcode_i(tty, TTYC_SMULX, 2);