croatoan [1] is a set of bindings to the ncurses terminal / console library for Common Lisp.

It allows easy creation of simple text-based GUI interfaces in the terminal / console.

It is inspired by, but not derived from similar libraries cl-ncurses and cl-charms.

Its main goal is to provide a higher-level, lispy/CLOSy interface, whereas the existing bindings clone the cryptic C API.

As of now (2016), the library is in active development an hopefully usable stage. Ncurses is old and huge and it will take a while to cover completely. The API is not yet fully stable.

It was tested on Linux x86_64, Ubuntu 16.04, SBCL 1.3.11, ncurses 6.0.

More testing is needed on implementations other than SBCL and operating systems other than Ubuntu.

It is available on quicklisp since october 2014 an can be easily installed by calling (ql:quickload :croatoan)

The basic functionality is shown in the following example:

(defun test1 () (with-screen (scr :input-echoing nil :input-blocking t :enable-colors t) (clear scr) (move scr 2 0) (format scr "Type chars. Type q to quit.~%~%") (refresh scr) (setf (.color-pair scr) '(:yellow :red) (.attributes scr) '(:bold)) (event-case (scr event) (#\q (return-from event-case)) (otherwise (princ event scr) (refresh scr)))))

The macro with-screen is the main entry point. It creates the main output window called screen, and passes init options to it.

We now can clear the screen, move the cursor (to the third row and first column), output text at cursor position, set foreground and background colors, text attributes or catch keyboard and mouse events with the macro event-case. Every change to the screen is only displayed after an explicit call to refresh.

Further documentation on features like windows, menus, mouse and input and output options is provided by the docstrings on quickdocs [2] and in the included examples.


[1] - croatoan github repository

[2] - croatoan quickdocs api documentation