File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
- ## Added
4
-
5
3
## Fixed
6
4
7
- ## Changed
5
+ - Couple the lifetime of the Clojure process to the lifetime of launchpad, exit
6
+ launchpad when the process dies, and kill the process when launchpad exits
8
7
9
8
# 0.8.46-alpha (2022-10-07 / 4c68918)
10
9
@@ -69,4 +68,4 @@ Initial release
69
68
- lambdaisland.classpath integration
70
69
- Support for cider-nrepl, refactor-nrepl
71
70
- Basic support for shadow-cljs cljs nREPL-base REPL
72
- - Auto-connect for Emacs
71
+ - Auto-connect for Emacs
Original file line number Diff line number Diff line change 318
318
(let [args (clojure-cli-args ctx)]
319
319
(apply debug (map shellquote args))
320
320
(let [process (process args {:env env :out :inherit :err :inherit })]
321
- (future
322
- (System/exit (.waitFor process)))
323
321
(assoc ctx :clojure-process process))))
324
322
325
323
(defn maybe-connect-emacs [{:keys [options nrepl-port project-root] :as ctx}]
397
395
:or {steps default-steps
398
396
project-root (find-project-root )}}]
399
397
400
- (reduce #(%2 %1 )
401
- {:main-opts *command-line-args*
402
- :executable (or executable
403
- (str/replace *file*
404
- (str project-root " /" )
405
- " " ))
406
- :project-root project-root}
407
- steps)
408
- @(promise )))
398
+ (let [ctx (reduce #(%2 %1 )
399
+ {:main-opts *command-line-args*
400
+ :executable (or executable
401
+ (str/replace *file*
402
+ (str project-root " /" )
403
+ " " ))
404
+ :project-root project-root}
405
+ steps)
406
+ process (:clojure-process ctx)]
407
+ (.addShutdownHook (Runtime/getRuntime )
408
+ (Thread. (fn [] (.destroy (:proc process)))))
409
+ (System/exit (:exit @process)))))
You can’t perform that action at this time.
0 commit comments