How do I write a console application with windows on the terminal in Ruby?

I want to write a simple client-client in Ruby for the terminal. The problem is that I need two separate "windows", one for the chatlog and one for input. I do not know how to do that. I've looked at (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 that if a new line appears, the top frame should scroll, but the tooltip should stay in place. And if I write something in the input prompt, the text should disappear when the user hits ENTER.

0


source to share


1 answer


Well, ncurses (and its ruby ​​binding library) allows you to do this, since all the related tools are with windows(1)

, talk(1)

and screen(1)

are written with ncurses. You can have multiple windows with (n) curses.



+3


source







All Articles