Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

color detection is wrong in NCstyle #49

Open
hramrach opened this issue Oct 6, 2016 · 1 comment
Open

color detection is wrong in NCstyle #49

hramrach opened this issue Oct 6, 2016 · 1 comment

Comments

@hramrach
Copy link

hramrach commented Oct 6, 2016

NCurses.cc

    yuiMilestone() << "have color = " << ::has_colors()  << std::endl;

    if ( want_colors() && ::has_colors() )
    {
        if ( ::start_color() != OK )
            throw NCursesError( "start_color() failed" );

        NCattribute::init_colors();
    }

NCattribute.h

inline static int colors()      { return _colors ? _colors : ::COLORS; }

NCattribute.cc

    yuiMilestone() << "Init " << term_t << " using " << ( NCattribute::colors() ? "color" : "bw" )

                   << " => " << MaxStyleSet << " styles in " << styleName << std::endl;

NCattribute::colors() is used to detect colorness but it returns non-false regradless of NCattribute::init_colors() being called or not.

@hramrach
Copy link
Author

hramrach commented Oct 6, 2016

so maybe add a flag that is set when NCattribute::init_colors() is called?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant