How do I get a terminal program to honour cursor keys?

懵懂的女人 提交于 2019-12-08 01:26:52

问题


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?


回答1:


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/.




回答2:


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.



来源:https://stackoverflow.com/questions/187219/how-do-i-get-a-terminal-program-to-honour-cursor-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!