Bug 229058

Summary: If NEWT_MONO does not exist, SLtt_Use_Ansi_Colors should still equal 1
Product: [Fedora] Fedora Reporter: David Cantrell <dcantrell>
Component: newtAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-17 12:27:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Cantrell 2007-02-16 18:59:40 UTC
The monochrome terminal change in libnewt forces color terminals to monochrome
anyway.  The following patch to newt.c sets SLtt_Use_Ansi_Colors to 1 if
NEWT_MONO does not exist.

--- newt-0.52.5/newt.c.color    2007-01-31 06:14:16.000000000 -0500
+++ newt-0.52.5/newt.c  2007-02-16 13:55:21.000000000 -0500
@@ -296,6 +296,8 @@
     MonoValue = getenv(MonoEnv);
     if ( MonoValue != NULL )
        SLtt_Use_Ansi_Colors = 0;
+    else if ( MonoValue == NULL )
+       SLtt_Use_Ansi_Colors = 1;
 
     if ((ret = SLsmg_init_smg()) < 0)
        return ret;

My understanding is that if you want to use newt in monochrome mode, you'll need
to set the NEWT_MONO environment variable.  If it doesn't exist, we get color.

Thanks.

Comment 1 Miroslav Lichvar 2007-02-17 12:27:14 UTC
With the above patch you are forcing newt to use color mode even on monochrome
terminals. That's exactly the bug that was fixed in the latest newt. Slang sets
SLtt_Use_Ansi_Colors to 1, but only if the terminal supports colors (in terminfo
database).

It's possible to force color mode with slang's variable COLORTERM.