views:

611

answers:

1

I want to write a simple chat-client in Ruby for the terminal. The Problem is, that I need two separate "windows", one for the chatlog and another for the input prompt. I dont have a clue how to do this. I watched (n)curses and some other ruby-libs, but nothing gives me this functionality.

.------------------------------.
| Mike: Hi Jenny               |
| Jenny: Hi Mike, how are you? |
|------------------------------|
|> I am fine_                  |
`------------------------------'

The big Problem is, if a new Line arives, the upper frame should scroll, but the prompt should stay on its position. And if I write something in the input prompt, the text should disappear when the user press ENTER.

Any ideas?

Aaron

+3  A: 

Well, ncurses (and its ruby binding library) does allow you for this since all the corresponding tools with windows(1), talk(1) and screen(1) are written with ncurses. You can have multiple windows with (n)curses.

Keltia
I can't find any information about how to use curses-lib from the ruby-stdlib :-(
Fu86
If you install the ncurses gem, you have some examples in there.
Keltia
just a note to mention that ncurses has yet to be ported to windows. For that you must use curses
Nuno Furtado