Bug 229058 - If NEWT_MONO does not exist, SLtt_Use_Ansi_Colors should still equal 1
If NEWT_MONO does not exist, SLtt_Use_Ansi_Colors should still equal 1
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: newt (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miroslav Lichvar
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-16 13:59 EST by David Cantrell
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-17 07:27:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Cantrell 2007-02-16 13:59:40 EST
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 07:27:14 EST
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.

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