How do I get a terminal program to honour cursor keys?
Question
I'm using ccl/openmcl on Mac OS X. (latest versions of both). When the lisp prompt is displayed, using the cursor keys to navigate the current line results in escape codes, rather than movement, eg:
Welcome to Clozure Common Lisp Version 1.2-r9226-RC1 (DarwinX8664)!
? (^[[D
Here I've pressed the (
key, and then the left cursor
key.
When I run ccl/openmcl on a Debian Etch box, the cursor behaves as expected, and moves the insert point one position left.
I guess this is some sort of terminal configuration option?
Solution
If Clozure CL doesn't provide native readline/editline/whatever support or is configured not to use it, you can run it with rlwrap, for example:
rlwrap openmcl
rlwrap can be obtained via MacPorts or directly from http://utopia.knoware.nl/~hlub/rlwrap/.
OTHER TIPS
i know that i'm not answering the question with this, but you should not spend much time directly using a lisp repl.
using emacs and slime is a much more convenient way of interacting with a lisp. you have an inspector and a debugger at hand, you can jump to the source code of the functions, etc.