Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use repl.send-signal to interrupt stdio REPLs #499

Merged
merged 1 commit into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fnl/conjure/client/hy/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@
(log.dbg "sending interrupt message" "")
(with-repl-or-warn
(fn [repl]
(let [uv vim.loop]
(uv.kill repl.pid uv.constants.SIGINT)))))
(log.append [(.. comment-prefix " Sending interrupt signal.")] {:break? true})
(log.append ["; Sending interrupt signal."] {:break? true})
(repl.send-signal vim.loop.constants.SIGINT))))

(defn on-filetype []
(mapping.buf
Expand Down
4 changes: 2 additions & 2 deletions fnl/conjure/client/julia/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
(defn interrupt []
(with-repl-or-warn
(fn [repl]
(let [uv vim.loop]
(uv.kill repl.pid uv.constants.SIGINT)))))
(log.append [(.. comment-prefix " Sending interrupt signal.")] {:break? true})
(repl.send-signal vim.loop.constants.SIGINT))))

(defn on-filetype []
(mapping.buf
Expand Down
4 changes: 2 additions & 2 deletions fnl/conjure/client/python/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,8 @@
(defn interrupt []
(with-repl-or-warn
(fn [repl]
(let [uv vim.loop]
(uv.kill repl.pid uv.constants.SIGINT)))))
(log.append [(.. comment-prefix " Sending interrupt signal.")] {:break? true})
(repl.send-signal vim.loop.constants.SIGINT))))

(defn on-filetype []
(mapping.buf
Expand Down
7 changes: 2 additions & 5 deletions fnl/conjure/client/racket/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@
(defn interrupt []
(with-repl-or-warn
(fn [repl]
(log.append ["; Sending interrupt signal."] {:break? true})

;; SIGINT C-c
;; https://github.com/Olical/conjure/issues/213
(repl.send-signal 2))))
(log.append [(.. comment-prefix " Sending interrupt signal.")] {:break? true})
(repl.send-signal vim.loop.constants.SIGINT))))

(defn eval-file [opts]
(eval-str (a.assoc opts :code (.. ",require-reloadable " opts.file-path))))
Expand Down
5 changes: 3 additions & 2 deletions lua/conjure/client/hy/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@ _2amodule_2a["on-exit"] = on_exit
local function interrupt()
log.dbg("sending interrupt message", "")
local function _26_(repl)
local uv = vim.loop
return uv.kill(repl.pid, uv.constants.SIGINT)
log.append({(comment_prefix .. " Sending interrupt signal.")}, {["break?"] = true})
log.append({"; Sending interrupt signal."}, {["break?"] = true})
return repl["send-signal"](vim.loop.constants.SIGINT)
end
return with_repl_or_warn(_26_)
end
Expand Down
4 changes: 2 additions & 2 deletions lua/conjure/client/julia/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ end
_2amodule_2a["on-exit"] = on_exit
local function interrupt()
local function _21_(repl)
local uv = vim.loop
return uv.kill(repl.pid, uv.constants.SIGINT)
log.append({(comment_prefix .. " Sending interrupt signal.")}, {["break?"] = true})
return repl["send-signal"](vim.loop.constants.SIGINT)
end
return with_repl_or_warn(_21_)
end
Expand Down
4 changes: 2 additions & 2 deletions lua/conjure/client/python/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ end
_2amodule_2a["on-exit"] = on_exit
local function interrupt()
local function _31_(repl)
local uv = vim.loop
return uv.kill(repl.pid, uv.constants.SIGINT)
log.append({(comment_prefix .. " Sending interrupt signal.")}, {["break?"] = true})
return repl["send-signal"](vim.loop.constants.SIGINT)
end
return with_repl_or_warn(_31_)
end
Expand Down
4 changes: 2 additions & 2 deletions lua/conjure/client/racket/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ end
_2amodule_2a["eval-str"] = eval_str
local function interrupt()
local function _8_(repl)
log.append({"; Sending interrupt signal."}, {["break?"] = true})
return repl["send-signal"](2)
log.append({(comment_prefix .. " Sending interrupt signal.")}, {["break?"] = true})
return repl["send-signal"](vim.loop.constants.SIGINT)
end
return with_repl_or_warn(_8_)
end
Expand Down