Subject: Re: Colour curses programs now default to white on black
To: NetBSD current-users mailing list <current-users@netbsd.org>
From: Julian Coleman <jdc@coris.demon.co.uk>
List: current-users
Date: 08/06/2002 15:44:24
Matthias Scheler wrote:
> Any chance to make that optional e.g. allow an override by an environment
> variable? I really liked "mutt" in "back" on "grey85". Even if I configure
> "mutt" to use "black" on "white" it doesn't like before.

Have you recompiled mutt?  If so, it should use the use_default_colors()
function.  In conjunction with :

	color normal default default

in your .muttrc, it should keep the terminal's default colours.

Alternatively, how about :

 ---8<---------------------------- Cut here ---------------------------->8---
--- color.c.orig	Tue Aug  6 12:01:18 2002
+++ color.c	Tue Aug  6 11:48:14 2002
@@ -47,6 +47,9 @@
 /* Have we initialised colours? */
 int	__using_color = 0;
 
+/* Have we changed the default colours? */
+int	__changed_default_color = 0;
+
 /* Default colour number */
 attr_t	__default_color = 0;
 
@@ -265,6 +268,13 @@
 		}
 	}
 
+	/*
+	 * If the environment variable CURSES_DEFAULT_COLORS is set,
+	 * use the terminal's default colours.
+	 */
+	if (!__changed_default_color && getenv("CURSES_DEFAULT_COLORS") != NULL)
+		assume_default_colors(-1, -1);
+		
 	return(OK);
 }
 
@@ -399,6 +409,7 @@
 	if (__using_color)
 		__change_pair(PAIR_NUMBER(__default_color));
 
+	__changed_default_color = 1;
 	return(OK);
 }
 ---8<---------------------------- Cut here ---------------------------->8---
 
?

J

-- 
                    My other computer also runs NetBSD
                          http://www.netbsd.org/