2

I'm interested in writing a text-mode "gui" application with ruby. This means I need to have a way to output text anywhere I want in the terminal, move cursor around and react directly to different keypresses. Using color would also be a nice plus.

Is ncurses the only (or clearly best) way to go, or are there other options to consider? I'm not saying there's anything wrong with ncurses, but I like to be aware of my options. (For information about using ncurses with Ruby, there's already another question.)

Community
  • 1
  • 1
Ilari Kajaste
  • 3,207
  • 2
  • 23
  • 25

1 Answers1

2

In C there were two historic choices for terminal blob graphics and text addressing: use ncurses or use the lower-level termcap/terminfo library. I imagine that for Ruby only ncurses bindings exist.

So I'm guessing that there are these choices:

  • Use ncurses as you mentioned
  • Use the lower-level termcap/terminfo lib. This doesn't really make any sense, plus you would probably have to make the ruby bindings yourself.
  • There are a number of widget libraries that wrap ncurses. See Newt, and Dialog, and CDK. You would probably have to create the Ruby bindings.
DigitalRoss
  • 143,651
  • 25
  • 248
  • 329