How to use arrow keys in mzscheme/guile REPL?

896 views Asked by At

When I'm typing in the REPL of guile or mzscheme

(define x 15)

and then press arrow key I get (define x 15)^[[D

Is it a terminal problem? or something needs to be configured? It's painful to rewrite a line for a simple edit

2

There are 2 answers

0
ayhid On

I found the answer for Guile, adding this in ~/.guile will cut it:

(use-modules (ice-9 readline))
(activate-readline)
0
ApproachingDarknessFish On

I do not know what guile is, but for mzscheme, you can input

(require readline)

To interactively enable the arrow-key behavior you're looking for. To enable this behavior when the REPL starts, run it using

mzscheme -il readline