# Ncurses like library?

**URL:** <https://rubytalk.org/t/ncurses-like-library/51153>\
**Category:** ruby-talk\
**Created:** [14 January 2009 16:31 UTC](https://rubytalk.org/t/ncurses-like-library/51153 "2009-01-14T16:31:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Mcd](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@Tim\_Mcd](https://rubytalk.org/u/Tim_Mcd)\
**Post date:** [14 January 2009 16:31 UTC](https://rubytalk.org/t/ncurses-like-library/51153/1 "2009-01-14T16:31:06Z")

</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?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Jesus\_Gabriel\_y\_Gala](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jesus\_Gabriel\_y\_Gala](https://rubytalk.org/u/Jesus_Gabriel_y_Gala)\
**Post date:** [14 January 2009 16:39 UTC](https://rubytalk.org/t/ncurses-like-library/51153/2 "2009-01-14T16:39:11Z")

</div>

Hi, this might help:

[http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1](http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1)

Jesus.

> **···**
>
> On Wed, Jan 14, 2009 at 5:31 PM, Tim Mcd \<tmcdowell@gmail.com\> 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?

---

<div class="post-metadata">

**Author:** ![\_RK\_Sentinel](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_RK\_Sentinel](https://rubytalk.org/u/_RK_Sentinel)\
**Post date:** [15 January 2009 05:27 UTC](https://rubytalk.org/t/ncurses-like-library/51153/3 "2009-01-15T05:27:46Z")

</div>

Tim Mcd 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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Tj\_Holowaychuk](https://avatars.discourse-cdn.com/v4/letter/t/ccd318/32.png) [@Tj\_Holowaychuk](https://rubytalk.org/u/Tj_Holowaychuk)\
**Post date:** [16 January 2009 00:29 UTC](https://rubytalk.org/t/ncurses-like-library/51153/4 "2009-01-16T00:29:32Z")

</div>

Tim Mcd 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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Andy\_Cooper](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@Andy\_Cooper](https://rubytalk.org/u/Andy_Cooper)\
**Post date:** [14 January 2009 16:43 UTC](https://rubytalk.org/t/ncurses-like-library/51153/5 "2009-01-14T16:43:40Z")

</div>

> Hi, this might help:
> 
> [http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1](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:** ![Phlip1](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Phlip1](https://rubytalk.org/u/Phlip1)\
**Post date:** [15 January 2009 14:49 UTC](https://rubytalk.org/t/ncurses-like-library/51153/6 "2009-01-15T14:49:06Z")

</div>

Ruby Rabbit 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:** ![Tim\_Mcd](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@Tim\_Mcd](https://rubytalk.org/u/Tim_Mcd)\
**Post date:** [16 January 2009 01:26 UTC](https://rubytalk.org/t/ncurses-like-library/51153/7 "2009-01-16T01:26:19Z")

</div>

Tj Holowaychuk wrote:

> Tim Mcd 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

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![\_RK\_Sentinel](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_RK\_Sentinel](https://rubytalk.org/u/_RK_Sentinel)\
**Post date:** [16 January 2009 06:33 UTC](https://rubytalk.org/t/ncurses-like-library/51153/8 "2009-01-16T06:33:47Z")

</div>

Tj Holowaychuk wrote:

> Tim Mcd 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!

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Tim\_Mcd](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@Tim\_Mcd](https://rubytalk.org/u/Tim_Mcd)\
**Post date:** [14 January 2009 16:49 UTC](https://rubytalk.org/t/ncurses-like-library/51153/9 "2009-01-14T16:49:17Z")

</div>

Andy Cooper wrote:

> > Hi, this might help:
> > 
> > [http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1](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?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Michal\_hramrach\_Such](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Michal\_hramrach\_Such](https://rubytalk.org/u/Michal_hramrach_Such)\
**Post date:** [15 January 2009 14:59 UTC](https://rubytalk.org/t/ncurses-like-library/51153/10 "2009-01-15T14:59:18Z")

</div>

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

> **···**
>
> 2009/1/15 Phlip \<phlip2005@gmail.com\>:
> 
> > Ruby Rabbit 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:** ![\_RK\_Sentinel](https://avatars.discourse-cdn.com/v4/letter/_/45deac/32.png) [@\_RK\_Sentinel](https://rubytalk.org/u/_RK_Sentinel)\
**Post date:** [15 January 2009 15:51 UTC](https://rubytalk.org/t/ncurses-like-library/51153/11 "2009-01-15T15:51:49Z")

</div>

Phlip wrote:

> Ruby Rabbit 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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Tj\_Holowaychuk](https://avatars.discourse-cdn.com/v4/letter/t/ccd318/32.png) [@Tj\_Holowaychuk](https://rubytalk.org/u/Tj_Holowaychuk)\
**Post date:** [16 January 2009 07:03 UTC](https://rubytalk.org/t/ncurses-like-library/51153/12 "2009-01-16T07:03:15Z")

</div>

RK Sentinel wrote:

> Tj Holowaychuk wrote:
> 
> > Tim Mcd 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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Michal\_hramrach\_Such](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Michal\_hramrach\_Such](https://rubytalk.org/u/Michal_hramrach_Such)\
**Post date:** [14 January 2009 16:58 UTC](https://rubytalk.org/t/ncurses-like-library/51153/13 "2009-01-14T16:58:34Z")

</div>

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

> **···**
>
> 2009/1/14 Tim Mcd \<tmcdowell@gmail.com\>:
> 
> > Andy Cooper wrote:
> > 
> > > > Hi, this might help:
> > > > 
> > > > [http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1](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:** ![Jesus\_Gabriel\_y\_Gala](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@Jesus\_Gabriel\_y\_Gala](https://rubytalk.org/u/Jesus_Gabriel_y_Gala)\
**Post date:** [14 January 2009 17:05 UTC](https://rubytalk.org/t/ncurses-like-library/51153/14 "2009-01-14T17:05:06Z")

</div>

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 Khair 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.

> **···**
>
> On Wed, Jan 14, 2009 at 5:49 PM, Tim Mcd \<tmcdowell@gmail.com\> wrote:
> 
> > Andy Cooper wrote:
> > 
> > > > Hi, this might help:
> > > > 
> > > > [http://letmegooglethatforyou.com/?q=ruby+ncurses&l=1](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:** ![Tim\_Mcd](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@Tim\_Mcd](https://rubytalk.org/u/Tim_Mcd)\
**Post date:** [14 January 2009 17:03 UTC](https://rubytalk.org/t/ncurses-like-library/51153/15 "2009-01-14T17:03:03Z")

</div>

Michal Suchanek 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?
> 
> 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?

> **···**
>
> > 2009/1/14 Tim Mcd \<tmcdowell@gmail.com\>:
> 
> > 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
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Tim\_Mcd](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@Tim\_Mcd](https://rubytalk.org/u/Tim_Mcd)\
**Post date:** [14 January 2009 17:25 UTC](https://rubytalk.org/t/ncurses-like-library/51153/16 "2009-01-14T17:25:40Z")

</div>

Jesús Gabriel y Galán wrote:

> **···**
>
> > On Wed, Jan 14, 2009 at 5:49 PM, Tim Mcd \<tmcdowell@gmail.com\> 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 Khair 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?  
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Sean\_O\_Halpin](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Sean\_O\_Halpin](https://rubytalk.org/u/Sean_O_Halpin)\
**Post date:** [16 January 2009 13:43 UTC](https://rubytalk.org/t/ncurses-like-library/51153/17 "2009-01-16T13:43:13Z")

</div>

You can get the work-in-progress here:

&nbsp;&nbsp;[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

> **···**
>
> On Wed, Jan 14, 2009 at 5:05 PM, Jesús Gabriel y Galán \<jgabrielygalan@gmail.com\> wrote:
> 
> > Also Sean O'Halpin was working in a FFI wrapper for ncurses which might be  
> > interesting.

---

<div class="post-metadata">

**Author:** ![Michal\_hramrach\_Such](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@Michal\_hramrach\_Such](https://rubytalk.org/u/Michal_hramrach_Such)\
**Post date:** [15 January 2009 11:09 UTC](https://rubytalk.org/t/ncurses-like-library/51153/18 "2009-01-15T11:09:56Z")

</div>

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

> **···**
>
> 2009/1/14 Tim Mcd \<tmcdowell@gmail.com\>:
> 
> > Michal Suchanek wrote:
> > 
> > > 2009/1/14 Tim Mcd \<tmcdowell@gmail.com\>:
> > > 
> > > > 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?

---

<div class="post-metadata">

**Author:** ![Tim\_Mcd](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@Tim\_Mcd](https://rubytalk.org/u/Tim_Mcd)\
**Post date:** [17 January 2009 00:15 UTC](https://rubytalk.org/t/ncurses-like-library/51153/19 "2009-01-17T00:15:18Z")

</div>

Sean O'halpin wrote:

> **···**
>
> > On Wed, Jan 14, 2009 at 5:05 PM, Jes�s Gabriel y \> Gal�n\<jgabrielygalan@gmail.com\> 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:
> > 
> > &nbsp;&nbsp;[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?  
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).

---

<div class="post-metadata">

**Author:** ![Rg\_Rg](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@Rg\_Rg](https://rubytalk.org/u/Rg_Rg)\
**Post date:** [12 February 2009 20:27 UTC](https://rubytalk.org/t/ncurses-like-library/51153/20 "2009-02-12T20:27:56Z")

</div>

Tim Mcd wrote:

> Sean O'halpin 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:
> > 
> > &nbsp;&nbsp;[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.

> **···**
>
> > > On Wed, Jan 14, 2009 at 5:05 PM, Jes�s Gabriel y \>\> Gal�n\<jgabrielygalan@gmail.com\> wrote:
> 
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
