This is a small PR that adds the ability to traverse previously executed commands in the interactive frontend, as well as move the cursor throughout the input before executing. This saves time having to re-write misspelled commands.
This is achieved using the popular GNU readline library. Justification for using an entire additional library is that implementing command history is not entirely trivial - escape codes for the arrow keys are terminal dependent, for example. Other shell-esque tools like the Python interactive interpreter also use readline.
Alternatively, tools such as rlwrap, rlfe and the readline runtime already exist that 'wrap' io to the program to emulate these features, but they must be installed and executed separately by the user.
This is a small PR that adds the ability to traverse previously executed commands in the interactive frontend, as well as move the cursor throughout the input before executing. This saves time having to re-write misspelled commands.
This is achieved using the popular GNU
readline
library. Justification for using an entire additional library is that implementing command history is not entirely trivial - escape codes for the arrow keys are terminal dependent, for example. Other shell-esque tools like the Python interactive interpreter also use readline.Alternatively, tools such as
rlwrap
,rlfe
and thereadline
runtime already exist that 'wrap' io to the program to emulate these features, but they must be installed and executed separately by the user.