Jackson Tale
Jackson Tale

Reputation: 25842

How to move the cursor in SML/NJ's REPL in terminal on Mac?

In the terminal of Mac OSX, I open SML, if I type something wrong, I wish to move my cursor to that place to modify something or add/delete something, but once I hit <- (the left arrow ) on the keyboard, the REPL gives me

enter image description here

Yes, that ^[[D thing.

So how do I move the cursor?

Upvotes: 2

Views: 835

Answers (1)

sepp2k
sepp2k

Reputation: 370425

Yes, the REPL of SML/NJ does not support arrow keys. You can use the rlwrap tool to fix this. That allows you to use the left and right arrow keys to navigate within a line and the up and down arrow keys to recall lines you've entered earlier.

If you're using Emacs to write your SML files, you can also run SML in an Emacs buffer.

Upvotes: 4

Related Questions