diff src/redisplay-tty.c @ 5475:248176c74e6b

Merge with trunk.
author Mats Lidell <matsl@xemacs.org>
date Sat, 23 Apr 2011 23:47:13 +0200
parents 308d34e9f07d 5256fedd50e6
children f87be7ddd60d
line wrap: on
line diff
--- a/src/redisplay-tty.c	Tue Mar 29 00:02:47 2011 +0200
+++ b/src/redisplay-tty.c	Sat Apr 23 23:47:13 2011 +0200
@@ -1114,6 +1114,13 @@
   if (CONSOLE_TTY_DATA (c)->width <= 0 || CONSOLE_TTY_DATA (c)->height <= 0)
     return TTY_SIZE_UNSPECIFIED;
 
+  CONSOLE_TTY_DATA (c)->colors = tgetnum("Co");
+  if (CONSOLE_TTY_DATA (c)->colors == 0)
+    CONSOLE_TTY_DATA (c)->colors = tgetnum("colors");
+  if (CONSOLE_TTY_DATA (c)->colors == 0)
+    /* There is always foreground and background. */
+    CONSOLE_TTY_DATA (c)->colors = 2;
+
   /*
    * Initialize cursor motion information.
    */