From: Patric Mueller Date: Mon, 13 Jun 2022 18:35:40 +0000 (+0200) Subject: Color check for 256 and 24 bit color output with enhanced symbols X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=193d0c43323930ac3c908227514affb1d4959efa;p=nethack Color check for 256 and 24 bit color output with enhanced symbols Adding a check for using the 256 or 24 bit color escape sequnces only if the terminal supports it. --- diff --git a/win/tty/wintty.c b/win/tty/wintty.c index f7c22458e..dc7560e63 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -3554,6 +3554,7 @@ tty_print_glyph(winid window, xchar x, xchar y, #ifdef ENHANCED_SYMBOLS /* we don't link with termcap.o if NO_TERMS is defined */ if ((tty_procs.wincap2 & WC2_U_24BITCOLOR) && SYMHANDLING(H_UTF8) + && iflags.colorcount >= 256 && glyphinfo->gm.u && glyphinfo->gm.u->ucolor) { term_start_24bitcolor(glyphinfo->gm.u); color24bit_on = TRUE;