Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Standard ML repeat last command, left arrow?

I am learning standard ML using its interpreter. Sometimes I make typo and just want to repeat the previous command like in Linux shell. However, up arrow will end up with printing special characters on the screen. Sometimes I want to go back left to correct something, left arrow also results in printing special characters.

Does anybody know what is the correct way to do them?

like image 874
Alfred Zhong Avatar asked Apr 07 '12 18:04

Alfred Zhong


2 Answers

I use Moscow ML, but I figure the answer will apply to whichever version you use:

You can achieve what you want by using rlwrap.

I have the following alias set in my .zshrc, which handles it automatically:

alias mosml="rlwrap mosml"

(Substitute mosml for the name of your SML interpreter.)

like image 111
Sebastian Paaske Tørholm Avatar answered Sep 28 '22 05:09

Sebastian Paaske Tørholm


Consider using the program ledit. It allows you to use the arrow keys to visit previous commands.

Example:

ledit mosml
like image 38
matzahboy Avatar answered Sep 28 '22 05:09

matzahboy