Bug 229058 - If NEWT_MONO does not exist, SLtt_Use_Ansi_Colors should still equal 1
Summary: If NEWT_MONO does not exist, SLtt_Use_Ansi_Colors should still equal 1
Alias: None
Product: Fedora
Classification: Fedora
Component: newt
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-16 18:59 UTC by David Cantrell
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-02-17 12:27:14 UTC
Type: ---

Attachments (Terms of Use)

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.


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

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

Note You need to log in before you can comment on or make changes to this bug.