Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make arrow keys work in MIT Scheme interpreter?

I have installed MIT Scheme from the instructions here on my laptop running Yosemite. I can get the scheme interpreter from Terminal, but none of my arrow keys seem to working. For any typing mistakes I make I cannot go back and correct it. I have to use backspace or re-type the whole thing.

Left arrow prints ^[[D

Right arrow prints ^[[C

Up arrow prints ^[[A

Down arrow prints ^[[B

Here's a screenshot:

screnshot showing arrow keys at work, not

like image 696
avi Avatar asked Aug 02 '15 05:08

avi


1 Answers

You could use rlwrap. Which is a wrap around the Readline. After installing in your system, just run as:

$ rlwrap mit-scheme

And it should work. There is a tutorial.

Even if it can be done, it doesn't mean you should. MIT-scheme already provides the Edwin editor, which is an emacs like editor, that works great. I use it everyday. It also comes with a graphical debugger. Your other options would be emacs+Geiser (or Greg's racket-mode), with guile or racket. Or DrRacket which is an IDE, with many aids for learning.

like image 103
Rptx Avatar answered Oct 11 '22 14:10

Rptx