From 0f28dea62bdefa4e38c85a6ad3d8896fdc458841 Mon Sep 17 00:00:00 2001 From: Artem Medeu Date: Wed, 10 Jul 2024 13:02:40 +0500 Subject: [PATCH] fix: terminate running repl on shutdown --- src/k16/kmono/repl/deps.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/k16/kmono/repl/deps.clj b/src/k16/kmono/repl/deps.clj index 78431f1..3a2ecf5 100644 --- a/src/k16/kmono/repl/deps.clj +++ b/src/k16/kmono/repl/deps.clj @@ -266,5 +266,8 @@ (ansi/print-info "Running clojure...") (when verbose? (print-clojure-cmd sdeps-overrides main-opts)) - (bp/shell clojure-cmd)))) + (let [proc (bp/shell {:continue true} clojure-cmd)] + (doto (Runtime/getRuntime) + (.addShutdownHook (Thread. (fn [] (bp/destroy proc))))) + (bp/check proc)))))