tags:

views:

139

answers:

1

Hi all,

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

+3  A: 

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

socat READLINE EXEC:sml

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

EDIT2: Ugh, I'm missing an option to socat to make it really work, but I can't seem to recall it from memory (it's been quite some time since I worked with SML/NJ).

EDIT3: Last edit, I hope. Removed the "pty" option -- unnecessary here. Apologies for all the edits :)

ZoogieZork
on my Linux, I use "rlwrap" to do the same thing: http://utopia.knoware.nl/~hlub/rlwrap/
newacct
THANK YOU ^_^ Oh that feels so much better (though it took a fair bit of work getting socat up and working. The next box is a Linux).
paul.meier
This is so awesome, thank you!
icco