]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Improve support of xterm on deficient platforms.
authorBruno Haible <bruno@clisp.org>
Tue, 19 Dec 2006 20:17:26 +0000 (20:17 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:32 +0000 (12:14 +0200)
gnulib-local/ChangeLog
gnulib-local/lib/term-ostream.oo.c

index e556282f8b0afafe87f17552b0b27e23eda466e8..d26df7553bd1d54d217d562e20696ed825e2f8de 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-19  Bruno Haible  <bruno@clisp.org>
+
+       * lib/term-ostream.oo.c (term_ostream_create): Add color information
+       about xterm if the platform lacks it.
+
 2006-12-19  Bruno Haible  <bruno@clisp.org>
 
        * lib/term-ostream.oo.c: Include terminfo.h instead of termcap.h.
index 657a479645fb5cd4c484ff00c2afaee32d1a0454..d731ed0aa9777106d1f50325b57e0f91196bd5e3 100644 (file)
@@ -1787,6 +1787,19 @@ term_ostream_create (int fd, const char *filename)
            abort ();
        }
 #endif
+
+      /* AIX 4.3.2, IRIX 6.5, HP-UX 11, Solaris 7..10 all lack the
+        description of color capabilities of "xterm" and "xterms"
+        in their terminfo database.  But it is important to have
+        color in xterm.  So we provide the color capabilities here.  */
+      if (stream->max_colors <= 1
+         && (strcmp (term, "xterm") == 0 || strcmp (term, "xterms") == 0))
+       {
+         stream->max_colors = 8;
+         stream->set_a_foreground = xstrdup ("\033[3%p1%dm");
+         stream->set_a_background = xstrdup ("\033[4%p1%dm");
+         stream->orig_pair = xstrdup ("\033[39;49m");
+       }
     }
 
   /* Infer the capabilities.  */