I have a piece of code I'm working on (for those interested, it's a lightweight, extensible Perl ICB client intended to replace CICB) which really needs to be able to use Curses.pm and Term::ANSIColor.

Either one individually works. The interactive mode that uses Curses works fine so long as I don't try to turn on color, and Term::ANSIColor works fine in the non-interactive query-only mode that doesn't use Curses. However, they won't work together. Curses::has_colors() stubbornly returns false in terminals that I know full well not only support color, but support color in curses-based programs. I've updated my system curses library to ncurses-5.3, and updated to the latest release of Curses.pm, to no avail. Last night I updated to perl-5.8 in the hope that this was one of the many bugs fixed, only to find that Curses.pm won't even build under Perl 5.8.

I seek enlightenment as to why Curses.pm does not believe in color-capable terminals. I've heard it said, but have been unable to confirm, that this is because although it ostensibly supports all the functions, Curses.pm does not actually support color. Is this actually the case? And if so, is it possible for me to use ncurses functions directly through the syscall interface to achieve my desired ends of color text in a curses window?

(My copies of the books of the sainted scribes of O'Reilly are, sadly, in storage until I find work again.)


In reply to Curses.pm with Term::ANSIColor by Llew_Llaw_Gyffes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.