How to 'fix' the SML/NJ interactive system to use Arrow Keys

倖福魔咒の 提交于 2019-11-29 00:54:22

问题


I'm having some trouble using SML/NJ interactive system, namely, that when I try to use my arrow keys (either left or right to make a correction in the expression I've typed, up to repeat the last expression), my Terminal prints codes. (e.g. ^[[A for up^[[D for left, etc.). While I can still use the system, it makes it very tedious.

I've looked around in Control.Compiler, is there something I'm missing? For whatever its worth, I'm using the Mac Terminal.

Thanks ^_^


回答1:


Try this. You can use socat to add readline support to many things:

socat READLINE EXEC:sml

I just realized you're on OS X. socat does seem to be available for OS X, although I have not tested it (this does work on Linux).




回答2:


Another option is rlwrap.

rlwrap sml


来源:https://stackoverflow.com/questions/1911861/how-to-fix-the-sml-nj-interactive-system-to-use-arrow-keys

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