[Openmcl-devel] CCL, ncurses, and raw mode

Daniel Kochmański daniel at turtleware.eu
Tue Mar 13 11:10:52 PDT 2018

> 1.  Ncurses does not play nicely with rlwrap.  This is not, if you think about it, entirely unexpected, but the *way* in which it fails is surprising (at least it was to me).  When running ncurses under rlwrap and you try to put it into raw mode, it actually works, but only after you have read one character from the keyboard.  After that, everything works properly.  But if the first character you type is ctrl-C or ctrl-Z then it will generate a signal rather than deliver the character to the input stream.  I still don’t have a good model of what is actually going on under the hood here.
FWIW I had a similar issue when I was working with cl-charms and swank. 
Problem was that CL REPL had already blocked read-char before ncurses 
was invoked which was not interrupted. I've solved it by putting a loop 
in REPL so read-char is not invoked when charms kicks in.

My scenario was:

     (progn (start-swank …) (loop (sleep 1))) ; initialize charms from slime

But I can imagine that the following should work too:

     (progn (your-ncurses-app) (loop (sleep 1)))


More information about the Openmcl-devel mailing list