Llew_Llaw_Gyffes has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: On to ... Curses and Term::ReadLine
by bbfu (Curate) on May 08, 2003 at 18:26 UTC | |
by Llew_Llaw_Gyffes (Scribe) on May 09, 2003 at 00:38 UTC |