So, after patching and building Curses.pm for Perl-5.8, I finally came to the conclusion that nothing I could do was going to make Term::ANSIColor work within a Curses window. This, however, is a surmountable problem, as once I found my bug, I was able to do all the text colorization in my interactive section through curses. It offends my sense of neatness somewhat to be using cursrs color in the interactive part and Term::ANSIColor in the non-interactive part, but that's the price for having output in the non-interactive part of the program be persistent on the terminal after the program exits. My reading and writing threads are playing nicely, ICBM talks to the ICB server properly ... the only major technical problem that now appears to lie before me is another interaction issue, this time trying to get Term::ReadLine and Curses.pm to play nicely together. From there on, it's just glue code and parsing.
I want to have readline-based editing in my input window, while restricting its effects to that particular curses window (occupying the bottom four lines of the terminal). It doesn't appear I can do this with Term::ReadLine, because I don't know any way to tell Term::ReadLine that I want the term object created in the existing curses window object. However, actualization is falling short of the goal. I can't clear my input window after the user hits enter, because the text typed in readline isn't "in" the window, but on top of it; and while I want text in the input window to just scroll up into invisibility if it exceeds four lines, what actually happens is the area of typed text grows upward, scrolling my other two windows above it (the server output window and the status line) to be pushed upwards, whereupon curses loses track of where they're supposed to be.
(Another minor oddity is that Term::Readline silently eats the first character of everything I type and does not display it, though it's present in the buffer returned from $term->readline.)
I'm about ready to abandon Term::ReadLine and implement my own readline-like functions using Term::ReadKey. Before I set off on this venture, am I needlessly reinventing the wheel? Is there a better way to do this? Is there some provision in curses itself for interactive input, or some undocumented trick that I can use to tell Term::ReadLine it lives strictly in its assigned curses window, not in the terminal as a whole?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.