I’m pleased to announce version 0.4.0 of the ffi-ncurses gem which
provides an FFI wrapper to the ncursesw library for creating
fullscreen terminal applications with cursor positioning, colour and
This release has much better support for Unicode (aka widechars) both
on input and output and fully implements the ncursesw widechar
routines. It has been tested on Ubuntu 10.04 and 11.04 with MRI 1.8.7,
1.9.2 and jruby-head in 1.8.7 and 1.9.2 modes. A previous version was
tested on Mac OS X 10.4 - this version should still work but I have
not been able to test it yet.
It also contains some more substantial examples, in particular
showing how to handle Unicode input (in examples/getkey.rb), how to
temporarily leaves ncurses (examples/temp_leave.rb) and how to use
pads and popup windows (examples/viewer.rb).
I’ve tried to retain backward compatibility for those libraries that
depend on it but if I’ve missed something, please let me know on the
github issues page (Issues · seanohalpin/ffi-ncurses · GitHub).
$ [sudo] gem install ffi-ncurses
To run the examples, change to a scratch directory then
$ gem unpack ffi-ncurses
$ cd ffi-ncurses-0.4.0/examples
Uses the ncursesw (widechar) version of ncurses by default.
Supports all functions in ncursesw except the =vwprintw/vwscanw=
Added =ACS= constants (box characters). See =examples/acs.rb= and
Added support for =libpanelw=. See =examples/panel_simple.rb=.
Methods with boolean arguments now accept =true= or =false= as well
as 1 or 0.
Better examples. See =examples/viewer.rb= for a simple but complete
file viewing application.
Sets the locale (using FFI::Locale.setlocale(LC_ALL, “”)) in ruby
1.8.x to enable UTF-8 input. This adds a dependency on the
ffi-locale gem. See =examples/getkey.rb= to see how to distinguish
between function keys and Unicode characters.
Start of a compatibility layer for the existing C extension-based
Ncurses Ruby libraries - require ‘ffi-ncurses/ncurses’. Runs all
the examples from ncurses-ruby without changes (except those relying
on menus and forms). See =examples/ncurses/*.rb=.
Source code available at GitHub - seanohalpin/ffi-ncurses: Interface to ncurses using Ruby FFI (Foreign Function Interface).