问题
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
Yes, that ^[[D
thing.
So how do I move the cursor?
回答1:
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.
来源:https://stackoverflow.com/questions/14489635/how-to-move-the-cursor-in-sml-njs-repl-in-terminal-on-mac