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

1

13

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

Favrot answered 2/8, 2015 at 5:24 Comment(3)
As it is said in the page you linked, you should use Emacs to interact with the Scheme interpreter. For a more friendly interaction, you could also use Racket instead of Scheme, with its own IDE.Netsuke
So, there is no other way to make it work in Terminal? Thanks for the tip of Racket. I will start using that instead.Favrot
As you said, in terminal you have to use backspace or re-type the whole thing.Netsuke
H
19

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.

Handyman answered 4/8, 2015 at 1:51 Comment(4)
hey, how do I start Edwin editor? I am doing SICP, thats the reason I have installed MIT Scheme. If you can share some resources/link about MIT Scheme, editor, debugger etc then it would be great.Favrot
to start it directly from the command line $ mit-scheme --edit Take a look at the documentationHandyman
docs are here now 👍Angelicaangelico
My scheme prompt is just scheme as I installed diff version using this, so starting the editor is scheme --edit. mit-scheme --edit returns command not found: mit-scheme which through me for a minute. In case anyone else runs into this...Fanfani

© 2022 - 2024 — McMap. All rights reserved.