# Help with ncurses

**URL:** <https://www.ruby-forum.com/t/help-with-ncurses/70616>\
**Category:** Ruby\
**Created:** [September 30, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/help-with-ncurses/70616 "2006-09-30T22:53:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [September 30, 2006, 10:53pm UTC](https://www.ruby-forum.com/t/help-with-ncurses/70616/1 "2006-09-30T22:53:11Z")

</div>

I want to ask ncurses for the terminal size, or to clear the screen,  
nothing more fancy than that. I have been playing around a bit  
without luck, a bit blindly due to the lack of library docs. Can  
anyone help?

– fxn

---

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [September 30, 2006, 11:23pm UTC](https://www.ruby-forum.com/t/help-with-ncurses/70616/2 "2006-09-30T23:23:13Z")

</div>

Xavier N. wrote:

> I want to ask ncurses for the terminal size, or to clear the screen,  
> nothing more fancy than that. I have been playing around a bit without  
> luck, a bit blindly due to the lack of library docs. Can anyone help?
> 
> – fxn

Lack of docs for -curses-?!

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/82359](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/82359)

If you find out the author of a Ruby binding didn’t go through  
copy/pasting the underlying C library’s documentation on his website for  
convenience, just look that up, or go figure in irb. Besides, the  
standard ruby curses binding works fine enough for that. Having never  
before used Curses, irb tells me about Curses::init\_screen,  
Curses::lines, Curses::cols, and Curses::clear…

David V.

---

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [September 30, 2006, 11:57pm UTC](https://www.ruby-forum.com/t/help-with-ncurses/70616/3 "2006-09-30T23:57:14Z")

</div>

On Sep 30, 2006, at 11:21 PM, David V. wrote:

> Lack of docs for -curses-?!  
> Lack of ncurses-ruby docs.

> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/82359](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/82359)

Yeah, I already glanced over that document before asking for help.

> If you find out the author of a Ruby binding didn’t go through  
> copy/pasting the underlying C library’s documentation on his  
> website for  
> convenience, just look that up, or go figure in irb.

Yes I did. The library docs says “This wrapper provides access to the  
functions, macros, global variables and constants of the ncurses  
library. These are mapped to a Ruby Module named “Ncurses”: Functions  
and external variables are implemented as singleton functions of the  
Module Ncurses.”

I played around with irb, with the output of Ncurses.methods.sort,  
etc. without luck.

> Besides, the  
> standard ruby curses binding works fine enough for that. Having never  
> before used Curses, irb tells me about Curses::init\_screen,  
> Curses::lines, Curses::cols, and Curses::clear…

Ah, now that is Curses, a standard library I didn’t remember  
(different from ncurses). In that library what I need is  
straigthforward to get.

– fxn
