From: Bruno Haible Date: Mon, 29 Jan 2024 18:19:11 +0000 (+0100) Subject: libtextstyle: Add a comment regarding COLORTERM. X-Git-Tag: v0.23~278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a64b941514f69ecb6c0ad4ba54f71eaed1af320c;p=thirdparty%2Fgettext.git libtextstyle: Add a comment regarding COLORTERM. * libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Add comment. --- diff --git a/libtextstyle/gnulib-local/lib/term-ostream.oo.c b/libtextstyle/gnulib-local/lib/term-ostream.oo.c index 36618a678..096058cc3 100644 --- a/libtextstyle/gnulib-local/lib/term-ostream.oo.c +++ b/libtextstyle/gnulib-local/lib/term-ostream.oo.c @@ -1,5 +1,5 @@ /* Output stream for attributed text, producing ANSI escape sequences. - Copyright (C) 2006-2008, 2017, 2019-2020, 2022-2023 Free Software Foundation, Inc. + Copyright (C) 2006-2008, 2017, 2019-2020, 2022-2024 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -2653,7 +2653,11 @@ term_ostream_create (int fd, const char *filename, ttyctl_t tty_control) || /* Recognize *-direct. */ (strlen (term) > 8 && strcmp (term + strlen (term) - 8, "-direct") == 0)) - ? (stream->max_colors >= 0x7fff ? cm_xtermrgb : + ? (/* Note: For recognizing cm_xtermrgb, + recommends to test + getenv ("COLORTERM"), but it does not seem like a good idea. + It's more of a quick hack that causes long-term problems. */ + stream->max_colors >= 0x7fff ? cm_xtermrgb : stream->max_colors == 256 ? cm_xterm256 : stream->max_colors == 88 ? cm_xterm88 : stream->max_colors == 16 ? cm_xterm16 :