Suppose I try to use an undefined variable in MIT Scheme's REPL:
1 ]=> blablabla
;Unbound variable: blablabla
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify a value to use instead of blablabla.
; (RESTART 2) => Define blablabla to a given value.
; (RESTART 1) => Return to read-eval-print level 1.
2 error>
This automatically brings me into the debugger. To exit the debugger, I have to type (restart 1)
. Is there an alternative way that does not involve typing 11 characters just to exit the debugger? It's a bit silly that all three options involve typing 11 characters.
According to Flux's answer, pressing CTRLC twice will work with
mit-scheme
, but not when it runs withinrlwrap
In order to make
rlwrap
more "transparent" with regard to CTRLC and CTRLG-W
(--polling
) option:rlwrap -W
will makerlwrap
wake up every 40 msecs to check whether the client has changed its terminal settings (in your case, its interrupt character).inputrc
:Those lines will tell
rlwrap
(when wrappingmit-scheme
) to pass on CTRLC and CTRLG even when in the middle of a line edit.With those two tweaks, I can't tell the difference anymore in interrupt behaviour between rlwrapped and unwrapped
mit-scheme
-W
needsrlwrap
>= 0.41,rlwrap-direct-keypress
>= 0.43For a more in-depth explanation why this works (and why the options and
.inputrc
entries are necessary) see this rlwrap issue on Github.