Skip to content

Commit

Permalink
Fix for issue Olical#497 Scheme client
Browse files Browse the repository at this point in the history
  • Loading branch information
russtoku committed May 25, 2023
1 parent 1dd96d9 commit 4dd024c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions doc/conjure-client-scheme-stdio.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ options relevant to these mappings.

<localleader>cS Stop any existing Scheme REPL.

<localleader>ei Interrupt running command. Same as pressing Ctrl-C
in a cmdline REPL.

==============================================================================
CONFIGURATION *conjure-client-scheme-stdio-configuration*

Expand Down
17 changes: 15 additions & 2 deletions fnl/conjure/client/scheme/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
{:scheme
{:stdio
{:mapping {:start "cs"
:stop "cS"}
:stop "cS"
:interrupt "ei"}
:command "mit-scheme"
;; Match "]=> " or "error> "
:prompt_pattern "[%]e][=r]r?o?r?> "
Expand Down Expand Up @@ -119,6 +120,12 @@
(fn [msg]
(log.append (format-msg msg)))}))))

(defn interrupt []
(with-repl-or-warn
(fn [repl]
(log.append ["; Sending interrupt signal."] {:break? true})
(repl.send-signal 2))))

(defn on-load []
(start))

Expand All @@ -131,7 +138,13 @@
(mapping.buf
:SchemeStop (cfg [:mapping :stop])
stop
{:desc "Stop the REPL"}))
{:desc "Stop the REPL"})

(mapping.buf
:SchemeInterrupt (cfg [:mapping :interrupt])
interrupt
{:desc "Interrupt the REPL"}))

(defn on-exit []
(stop))

0 comments on commit 4dd024c

Please sign in to comment.