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

avi
  • 9,292
  • 11
  • 47
  • 84
  • As it is said in the page you linked, you should use [Emacs](http://emacsformacosx.com/) to interact with the Scheme interpreter. For a more friendly interaction, you could also use [Racket](http://racket-lang.org) instead of Scheme, with its own IDE. – Renzo Aug 02 '15 at 05:43
  • So, there is no other way to make it work in Terminal? Thanks for the tip of Racket. I will start using that instead. – avi Aug 02 '15 at 06:06
  • As you said, in terminal you have to use backspace or re-type the whole thing. – Renzo Aug 02 '15 at 06:08

1 Answers1

18

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.

Rptx
  • 1,159
  • 1
  • 12
  • 17
  • 1
    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. – avi Aug 04 '15 at 07:14
  • 1
    to start it directly from the command line `$ mit-scheme --edit` Take a look at the [documentation](https://www.gnu.org/software/mit-scheme/documentation/mit-scheme-user/index.html) – Rptx Aug 04 '15 at 11:34
  • 1
    docs are [here](https://www.gnu.org/software/mit-scheme/documentation/stable/mit-scheme-user/Edwin.html#Edwin) now – Zev Averbach Aug 24 '22 at 11:30
  • My scheme prompt is just `scheme` as I installed diff version using [this](https://jacksonisaac.com/2014/03/25/installing-scheme-on-mac-os-x/), 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... – Mote Zart Jan 15 '23 at 18:01