]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libtextstyle: Support for terminal types with 256 colors.
authorBruno Haible <bruno@clisp.org>
Sun, 31 Mar 2019 14:50:40 +0000 (16:50 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 31 Mar 2019 15:07:22 +0000 (17:07 +0200)
* gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Accept all $TERM
values that end in -16color or -256 color (such as Eterm-256color,
mlterm-256color, or putty-256color).
* libtextstyle/NEWS: Mention the change.

gnulib-local/lib/term-ostream.oo.c
libtextstyle/NEWS

index 447af99686307e5ef8aab42df8557d23dd3684a0..5d3cf0698b248c45a8449f30dfa33abae0624cf5 100644 (file)
@@ -2210,10 +2210,12 @@ term_ostream_create (int fd, const char *filename, ttyctl_t tty_control)
          ? (term != NULL
             && (/* Recognize xterm-16color, xterm-88color, xterm-256color.  */
                 (strlen (term) >= 5 && memcmp (term, "xterm", 5) == 0)
-                || /* Recognize rxvt-16color.  */
-                   (strlen (term) >= 4 && memcmp (term, "rxvt", 4) == 0)
-                || /* Recognize konsole-16color.  */
-                   (strlen (term) >= 7 && memcmp (term, "konsole", 7) == 0))
+                || /* Recognize *-16color.  */
+                   (strlen (term) > 8
+                    && strcmp (term + strlen (term) - 8, "-16color") == 0)
+                || /* Recognize *-256color.  */
+                   (strlen (term) > 9
+                    && strcmp (term + strlen (term) - 9, "-256color") == 0))
             ? (stream->max_colors == 256 ? cm_xterm256 :
                stream->max_colors == 88 ? cm_xterm88 :
                stream->max_colors == 16 ? cm_xterm16 :
index cacd94630b159a18a262a23267f24a55df69aa5d..1ea300cb7c38e5c41193e4ce786b57b89207e471 100644 (file)
@@ -6,6 +6,7 @@ New in 0.8:
     with a low probability.
   - The SIGTSTP and SIGCONT signal handlers could clobber errno.
 * Added support for Windows consoles.
+* Improved support for TERM=Eterm-256color and TERM=mlterm-256color.
 
 New in 0.7:
 * Reliable tty control, as described by the ttyctl_t enum, is now implemented.