Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sml

smlnj

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 ^_^

like image 552
pablo.meier Avatar asked Sep 07 '25 16:09

pablo.meier


2 Answers

Another option is rlwrap.

rlwrap sml
like image 91
Telemachus Avatar answered Sep 12 '25 02:09

Telemachus


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

like image 20
ZoogieZork Avatar answered Sep 12 '25 02:09

ZoogieZork