canis
gem instead. Have a look at ncumbra
too.Please install rbcurse-core. I have just released 0.0.3 on Jan 5, 2012.
gem install rbcurse-core
Version 1.5.2 of rbcurse will install both core and rbcurse-extras.
Currently this repo (rbcurse) is in flux. I've moved stuff off to other repos (rbcurse-core, rbcurse-extras and rbcurse-experimental.). This will be a wrapper repo.
Please go to branch 1.4.1 for the last version of all code in one repo. Gem 1.4.1 is the last gem that contains all the code in one gem/repo.
A small but comprehensive widget library written in ruby for creating ncurses/curses applications. (Tested on 1.9.1/2, compatible with 1.8.7.)
rbcurse is now a meta-gem. It depends on core, extras and experimental. You may install core in isolation, too, if you don't want all these. Extras and experimental depend on core. rbcurse-core depends only on ffi-ncurses.
The essence of 'simple' is knowing "what to leave out" - attributed to Steve Jobs
2011-11-17 - I have spun off all the code into core, extras and experimental. Oh, wait, i've done all this in the 1.5.0 branch, did not think of first merging with master, since if things went wrong, master would be fine.
Merged with master. Now to update the gemspecs. Done that and created gems locally. Am testing them out, seems okay, will release shortly.
2011-11-16 - I am now working on 1.5.0, so please check that branch for latest work. I am separating the gem into core, extras and experimental. I am also moving to ruby 1.9.3.
Changes expected in 1.5.0:
2011-11-16 - I have released a 1.4.1.pre2 gem, and will make it 1.4.1 in a few days if all remains fine.
After releasing 1.4.1, I will be separating this gem into core, extras and experimental. Until now the basic widgets have often been volatile, with sudden changes coming in minor versions or patch versions. With 1.5.0, I hope to keep the core stable and back-compat.
I've totally rewritten tabbedpane and messagebox. Much simpler now. Will substitute this with existing one in 1.5.0 and push the existing ones into /deprecated. There is now support for printing colored text in ansi-escape format or a better format based on tmux's status-line config, which allows for nesting of colors. I need to iron out the interface.
Migrated from ncurses-ruby to ffi-ncurses since 1.3.0. Thanks Sean.
most
application. Saves on allocating keybindings and memorizing them.C-x C-f
or 15dd
)Above may be created using DSL like syntax, or hashes, and modified at runtime. Very flexible unlike ncurses forms and fields.
rbcurse tutorial (WIP - please review and give feedback) http://rbcurse.rubyforge.org/tut0.html
http://totalrecall.wordpress.com - blog, status, screenshots
Many working demos in examples folder, such as:
test2.rb - original test program containing various widgets, menu bar and tabbed pane
rfe.rb is a ruby file explorer demo.
sqlt.rb is a ruby sql client demo (using testd.db at http://www.benegal.org/files/screen/testd.db) (requires gem sqlite3) sqlm.rb: uses a multi-container - each query opens a new table in the multicontainer
alpmenu.rb - an alpine like menu screen that calls the following 2 programs
testtodo.rb is a test TODO application (M-h to see popup menus)
viewtodo.rb is a test TODO viewing application (now using sqlite3). The table is readonly, some vim keys are available.
app.rb - demo of the app feature. Also has progress bars (type in the textarea to see progress bar)
appemail.rb - a larger demo of the app feature and Column Browse pattern. Uses mbox to display mails. M-x to show commands at bottom of screen. Vim and bash-like file selection and other goodies. You will need to supply an mbox location.
appdirtree - demo of file browser using Tree on left and list on right.
dbdemo.rb - sqlite database query program
1.2.0: many additions (See CHANGELOG for details)
Please see CHANGELOG for changes.
Deprecated. Please use vimsplit instead. It's cleaner and hopefully easier to use. Splitpanes suffered from the problem of the system not knowing which pane the user was issuing a command (resize) in (when there were embedded panes).
Avoid this. Listboxes and textareas already implement scrolling. I was using pads to implement a viewport, this was slow esp with scrollpanes within splitpanes, but the copywin() and related methods often gave errors or seg-faults.
The following are issues with terminals (or with ncurses-ruby in some cases) not with rbcurse.
Some terminals may not show underlines (e.g screen). xterm-color is fine.
Some terminals do not process Function keys, avoid declaring F1 etc if unsure of client terminals. I have put in fixes for xterm-color F1 and backtab.
To use ALT/META keys on a Mac OS X, in Terminal preferences, under Keyboard, select "use Option as Meta key". All hotkeys are automatically, ALT combinations. In Iterm2 also, go to Preferences and select "Esc" for keys.
Some screens do not display window background color under spaces.
This is okay under "screen" and "xterm-color" but not under "xterm" and "xterm-256color". You will notice
this in the message box samples. I am trying hard to work around this since some terminals do not seem to
implement windows bkgd
method.
I am developing and testing under "gnu screen" (compiled with 256 colors) under OSX Lion, using zsh). I have just shifted to iTerm2 - this gives me some additional keys such as PageUp, PageDown, Home and End but takes away some others that Terminal gaves me such as shifted-function keys and Control-left, Ctrl-Right.
Just for information, I am transitioning from macports to homebrew. I use rvm.
ruby 1.9.1, 1.9.2, 1.9.3 (I believe it is working on 1.8.7, 1.8.6 as well).
ffi-ncurses (>= 0.4.0) Thanks Sean !
(In following commands, use sudo
if installing gems in readonly are such as /opt/local/).
gem install rbcurse
Now go to the the examples
folder and execute some examples. Each sample writes to a log file named rbc13.log (earlier view.log). If the examples folder is readonly, you will have to set LOGDIR
to a writable folder as below.
cd examples
ruby test2.rb
LOGDIR=~/tmp ruby test1.rb
To install only the core:
gem install rbcurse-core
Copyright (c) 2008 -2011 rkumar
Same as ruby license.