From: Bruno Haible Date: Tue, 19 Dec 2006 20:17:26 +0000 (+0000) Subject: Improve support of xterm on deficient platforms. X-Git-Tag: v0.17~554 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35232400b0930e39da7a24e3219b4b7eda3733f7;p=thirdparty%2Fgettext.git Improve support of xterm on deficient platforms. --- diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index e556282f8..d26df7553 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,8 @@ +2006-12-19 Bruno Haible + + * lib/term-ostream.oo.c (term_ostream_create): Add color information + about xterm if the platform lacks it. + 2006-12-19 Bruno Haible * lib/term-ostream.oo.c: Include terminfo.h instead of termcap.h. diff --git a/gnulib-local/lib/term-ostream.oo.c b/gnulib-local/lib/term-ostream.oo.c index 657a47964..d731ed0aa 100644 --- a/gnulib-local/lib/term-ostream.oo.c +++ b/gnulib-local/lib/term-ostream.oo.c @@ -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. */