# Ncurses like library?

**URL:** <https://www.ruby-forum.com/t/ncurses-like-library/157705>\
**Category:** Ruby\
**Created:** [January 14, 2009, 5:32pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705 "2009-01-14T17:32:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 5:32pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/1 "2009-01-14T17:32:02Z")

</div>

Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
putting graphics made with static text onto a terminal/DOS window?

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 5:40pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/2 "2009-01-14T17:40:46Z")

</div>

On Wed, Jan 14, 2009 at 5:31 PM, Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
> putting graphics made with static text onto a terminal/DOS window?

Hi, this might help:

> **[LMGTFY - Let Me Google That For You](https://lmgtfy.app/?q=ruby%2Bncurses&l=1)**
>
> For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.

Jesus.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 5:44pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/3 "2009-01-14T17:44:53Z")

</div>

> Hi, this might help:
> 
> [LMGTFY - Let Me Google That For You](http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1)
> 
> Jesus.

Why is it that site never gets old?  
Especially when it comes to the 2-3 Ncurses questions a day.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 5:50pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/4 "2009-01-14T17:50:14Z")

</div>

Andy C. wrote:

> > Hi, this might help:
> > 
> > [LMGTFY - Let Me Google That For You](http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1)
> > 
> > Jesus.
> 
> Why is it that site never gets old?  
> Especially when it comes to the 2-3 Ncurses questions a day.

Yeah, that ruby-ncurses binding isn’t the best, lots of methods are  
missing and other little things (like ‘include Ncurses’ not working  
correctly). Any OTHER TUI libraries?

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 6:00pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/5 "2009-01-14T18:00:46Z")

</div>

2009/1/14 Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Yeah, that ruby-ncurses binding isn’t the best, lots of methods are  
> missing and other little things (like ‘include Ncurses’ not working  
> correctly). Any OTHER TUI libraries?

If you look through the forum somebody suggested curses FFI bindings I  
think but I don’t know how far that got.

If you find the ruby curses bindings insufficient, post about its  
deficiencies so that they can be worked out.

I personally do not use them because they cannot do multibyte  
characters but that’s not limitation of these bindings but of the  
version 1.8 of the Ruby interpreter - it cannot use locales correctly.

Thanks

Michal

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/6 "2009-01-14T18:03:59Z")

</div>

Michal S. wrote:

> 2009/1/14 Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > Yeah, that ruby-ncurses binding isn’t the best, lots of methods are  
> > missing and other little things (like ‘include Ncurses’ not working  
> > correctly). Any OTHER TUI libraries?
> 
> If you look through the forum somebody suggested curses FFI bindings I  
> think but I don’t know how far that got.  
> I’ll look into that, thanks.

> If you find the ruby curses bindings insufficient, post about its  
> deficiencies so that they can be worked out.  
> I thought Ruby-Ncurses development was dead?

> I personally do not use them because they cannot do multibyte  
> characters but that’s not limitation of these bindings but of the  
> version 1.8 of the Ruby interpreter - it cannot use locales correctly.
> 
> Thanks
> 
> Michal

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 6:06pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/7 "2009-01-14T18:06:38Z")

</div>

On Wed, Jan 14, 2009 at 5:49 PM, Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Yeah, that ruby-ncurses binding isn’t the best, lots of methods are  
> missing and other little things (like ‘include Ncurses’ not working  
> correctly). Any OTHER TUI libraries?

Sorry, from the way you worded your question I assumed you wanted to  
know if there were any ruby ncurses bindings and I wanted to point out  
that some googling might help (admiteddly, I should have clicked the  
search, and not the “I’m feeling lucky” button, to show there were  
many results). You didn’t show that you had already evaluated some  
ncurses binding, so I assumed you didn’t. My bad.

From the questions in this list it seems there are other people using  
the ncurses gem. For example Nit K. posted many questions related  
to ncurses, maybe you can take a look at his questions. Also Sean  
O’Halpin was working in a FFI wrapper for ncurses which might be  
interesting.

Jesus.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 14, 2009, 6:26pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/8 "2009-01-14T18:26:36Z")

</div>

JesÃºs Gabriel y GalÃ¡n wrote:

> On Wed, Jan 14, 2009 at 5:49 PM, Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Yeah, that ruby-ncurses binding isn’t the best, lots of methods are  
> > missing and other little things (like ‘include Ncurses’ not working  
> > correctly). Any OTHER TUI libraries?
> 
> Sorry, from the way you worded your question I assumed you wanted to  
> know if there were any ruby ncurses bindings and I wanted to point out  
> that some googling might help (admiteddly, I should have clicked the  
> search, and not the “I’m feeling lucky” button, to show there were  
> many results). You didn’t show that you had already evaluated some  
> ncurses binding, so I assumed you didn’t. My bad.
> 
> From the questions in this list it seems there are other people using  
> the ncurses gem. For example Nit K. posted many questions related  
> to ncurses, maybe you can take a look at his questions. Also Sean  
> O’Halpin was working in a FFI wrapper for ncurses which might be  
> interesting.
> 
> Jesus.

> **[Term::Visual - split-terminal user interface - metacpan.org](https://metacpan.org/release/LUNARTEAR/Term-Visual-0.08/view/Visual.pm)**
>
> split-terminal user interface

Looks absolutely perfect. I can’t find anything related to getting it to  
work with Ruby, save for a post asking how to do it here on this list.  
No one replied to it. Anyone ever get it to work?

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 15, 2009, 6:28am UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/9 "2009-01-15T06:28:41Z")

</div>

Tim M. wrote:

> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
> putting graphics made with static text onto a terminal/DOS window?

I am surprised to hear that ncurses-ruby is not working or the include  
Ncurses is not working.

All my work uses ruby-ncurses as a base. Yes, there are a couple of  
things I have come across that were buggy - which I have pointed out on  
this forum.  
Sadly there seems to be no maintainer for it – have posted bugs but no  
response. But these are very minor and probably no one uses those  
things.

Please install the gem and then try the samples. Feel free to ask me  
anything - I just might be able to help and save you time, and am glad  
to answer.

oh, btw, just wondering – is the basic curses that comes with ruby  
working on your system.

Also, I believe I have done extensive and thorough searching on ncurses  
and ruby (2 months ago) and whatever libraries or wrappers I could find  
were long abandoned or had not released code.

Cheers,  
Sent.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 15, 2009, 3:51pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/10 "2009-01-15T15:51:19Z")

</div>

Ruby R. wrote:

> All my work uses ruby-ncurses as a base.

Can you use it in an existing console, such as to simply color text,  
without  
pretending it’s a window and taking over all of it?

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 15, 2009, 12:11pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/11 "2009-01-15T12:11:46Z")

</div>

2009/1/14 Tim M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > If you find the ruby curses bindings insufficient, post about its  
> > deficiencies so that they can be worked out.  
> > I thought Ruby-Ncurses development was dead?

I meant the ruby curses extension that is included in stdlib.

It is probably not developed very actively but if you find some  
limitations that can be resolved without introducing incompatibilities  
(or in any reasonable way for 1.9) there is a good chance that such  
change will be included.

Thanks

Michal

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 15, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/12 "2009-01-15T16:01:29Z")

</div>

2009/1/15 Phlip [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Ruby R. wrote:
> 
> > All my work uses ruby-ncurses as a base.
> 
> Can you use it in an existing console, such as to simply color text, without  
> pretending it’s a window and taking over all of it?

I guess that’s not what curses are meant for in general.

You can look up the terminal capabilities and use them to change  
colors but curses functions all operate on windows. Curses is a TUI  
library, not an output coloring library.

The situation is further complicated on Windows where the ‘console’ is  
very fishy and normally you cannot change the colors with writing  
terminal strings, only with Win32API calls.

Thanks

Michal

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 15, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/13 "2009-01-15T16:52:51Z")

</div>

Phlip wrote:

> Ruby R. wrote:
> 
> > All my work uses ruby-ncurses as a base.
> 
> Can you use it in an existing console, such as to simply color text,  
> without  
> pretending it’s a window and taking over all of it?

I am not exactly certain of what you mean, but have you tried Highline.

It does great coloring, I have run its demos but not really used it. A  
lot of people here have used it.

Also, iirc Facets has some module for ANSI-coloring. If i am not  
mistaken you can do something like a colored ls output (directory  
listing).

So do a give a look at Highline and Facets.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 16, 2009, 1:30am UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/14 "2009-01-16T01:30:37Z")

</div>

Tim M. wrote:

> Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
> putting graphics made with static text onto a terminal/DOS window?

this might help you as well

> **[GitHub - tj/commander: The complete solution for Ruby command-line executables](https://github.com/tj/commander/tree/master)**
>
> master

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 16, 2009, 7:34am UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/15 "2009-01-16T07:34:53Z")

</div>

Tj Holowaychuk wrote:

> Tim M. wrote:
> 
> > Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
> > putting graphics made with static text onto a terminal/DOS window?
> 
> this might help you as well
> 
> [GitHub - tj/commander: The complete solution for Ruby command-line executables](http://github.com/visionmedia/commander/tree/master)

Looks really good!

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 16, 2009, 8:03am UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/16 "2009-01-16T08:03:44Z")

</div>

RK Sentinel wrote:

> Tj Holowaychuk wrote:
> 
> > Tim M. wrote:
> > 
> > > Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
> > > putting graphics made with static text onto a terminal/DOS window?
> > 
> > this might help you as well
> > 
> > [GitHub - tj/commander: The complete solution for Ruby command-line executables](http://github.com/visionmedia/commander/tree/master)
> 
> Looks really good!

Thanks! that was my first Ruby library every actually haha, its still a  
work in progress but all the major tasks seem pretty solid now, just not  
alot of people know about it.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 16, 2009, 2:27am UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/17 "2009-01-16T02:27:24Z")

</div>

Tj Holowaychuk wrote:

> Tim M. wrote:
> 
> > Excuse me, but does anyone know of an Ncurses-like library for Ruby? For  
> > putting graphics made with static text onto a terminal/DOS window?
> 
> this might help you as well
> 
> [GitHub - tj/commander: The complete solution for Ruby command-line executables](http://github.com/visionmedia/commander/tree/master)

Isn’t quite what I was looking for, but man does it look neat! =D

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 17, 2009, 1:16am UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/18 "2009-01-17T01:16:26Z")

</div>

Sean O’halpin wrote:

> On Wed, Jan 14, 2009 at 5:05 PM, Jesï¿½s Gabriel y  
> Galï¿½n[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Also Sean O’Halpin was working in a FFI wrapper for ncurses which might be  
> > interesting.
> 
> You can get the work-in-progress here:
> 
> [GitHub - seanohalpin/ffi-ncurses: Interface to ncurses using Ruby FFI (Foreign Function Interface)](http://github.com/seanohalpin/ffi-ncurses/tree/master)
> 
> Mostly works (except for macros like getxy on Mac OS/X). See the  
> ./examples directory for usage.
> 
> Regards,  
> Sean

Wow, nice. Makes working with Ncurses that much simpler (no  
Ncurses.initscr because the include is busted \>\_\<). Is there a gem for  
it?

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [February 12, 2009, 9:29pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/19 "2009-02-12T21:29:13Z")

</div>

Tim M. wrote:

> Sean O’halpin wrote:
> 
> > On Wed, Jan 14, 2009 at 5:05 PM, Jesï¿½s Gabriel y  
> > Galï¿½n[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > Also Sean O’Halpin was working in a FFI wrapper for ncurses which might be  
> > > interesting.
> > 
> > You can get the work-in-progress here:
> > 
> > [GitHub - seanohalpin/ffi-ncurses: Interface to ncurses using Ruby FFI (Foreign Function Interface)](http://github.com/seanohalpin/ffi-ncurses/tree/master)
> > 
> > Mostly works (except for macros like getxy on Mac OS/X). See the  
> > ./examples directory for usage.
> > 
> > Regards,  
> > Sean
> 
> Wow, nice. Makes working with Ncurses that much simpler (no  
> Ncurses.initscr because the include is busted \>\_\<). Is there a gem for  
> it?

Has anyone tried this “gem”? → [http://rbcurse.rubyforge.org/](http://rbcurse.rubyforge.org/)  
Is registered in “RubyForge” on February 2, but looks good.

---

<div class="post-metadata">

**Author:** ![enchanter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ce7236/32.png) [@enchanter](https://www.ruby-forum.com/u/enchanter)\
**Post date:** [January 16, 2009, 2:47pm UTC](https://www.ruby-forum.com/t/ncurses-like-library/157705/20 "2009-01-16T14:47:15Z")

</div>

On Wed, Jan 14, 2009 at 5:05 PM, Jesús Gabriel y  
Galán[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Also Sean O’Halpin was working in a FFI wrapper for ncurses which might be  
> interesting.

You can get the work-in-progress here:

[GitHub - seanohalpin/ffi-ncurses: Interface to ncurses using Ruby FFI (Foreign Function Interface)](http://github.com/seanohalpin/ffi-ncurses/tree/master)

Mostly works (except for macros like getxy on Mac OS/X). See the  
./examples directory for usage.

Regards,  
Sean
