|
From: | Christer Enfors |
Subject: | Re: filter() prevents clearing of screen, but still clears current line |
Date: | Mon, 19 Mar 2007 15:39:13 +0100 |
User-agent: | Thunderbird 1.5.0.10 (Windows/20070221) |
Avery Pennarun wrote:
I've done this sort of thing at least twice in my life, and it turns out to be much easier than it sounds. Use terminfo ("man 3 terminfo"), part of ncurses, to get the codes you need to move to certain areas of the screen and interpret input characters. It's quite easy (and educational :)) to import a getline-type functionality by yourself.
Yeah, I'll do that. Thanks.
Alternatively, bypass curses/terminfo entirely and just send hardcoded vt100 codes. It's not like there are any terminals nowadays that don't support them, and you only need to remember about three of them (move cursor, clear line, enable/disable bold.
I considered doing that too, but I think that terminfo is a better option for me.
Input's a little trickier because you have to catch multi-character escape sequences. But if you code it up yourself, you can support multiple terminals much better than curses does: http://www.advogato.org/person/apenwarr/diary.html?start=17
That's funny. I read that exact blog entry just the other day. I must have come across it while searching for curses documentation or something.
-- Christer Enfors
[Prev in Thread] | Current Thread | [Next in Thread] |