Skip to content

Commit 5737a8c

Browse files
authored
Merge pull request #16 from arichiardi/inherit-io
Make sure the clojure process can communicate over `stdio`
2 parents 51547a1 + ba7d5d4 commit 5737a8c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
```
3535
Aliases: :dev, :home/cider, :home/zprint, :mine/local
3636
```
37+
- Make sure the clojure process can communicate over `stdio`.
3738

3839
# 0.42.182-alpha (2025-03-01 / 50cc172)
3940

src/lambdaisland/launchpad.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,13 +529,14 @@
529529
((run-process opts) ctx))
530530
([{:keys [cmd prefix working-dir
531531
background? timeout-ms check-exit-code? env
532-
color show-command?]
532+
show-command?]
533533
:or {working-dir "."
534534
check-exit-code? true
535535
show-command? true}}]
536536
(fn [ctx]
537537
(let [working-dir (io/file working-dir)
538538
proc-builder (doto (ProcessBuilder. (map str cmd))
539+
(.inheritIO)
539540
(.directory working-dir))
540541
_ (.putAll (.environment proc-builder) (or env (:env ctx)))
541542
color (mod (hash (or prefix (first cmd))) 8)
@@ -554,9 +555,8 @@
554555
(.waitFor process timeout-ms TimeUnit/MILLISECONDS)
555556
(.waitFor process))]
556557
(when (and check-exit-code? (not= 0 exit))
557-
(do
558-
(println (str prefix) "Exited with non-zero exit code: " exit)
559-
(System/exit exit)))
558+
(println prefix "Exited with non-zero exit code: " exit)
559+
(System/exit exit))
560560
ctx))))))
561561

562562
(defn start-clojure-process [{:keys [aliases nrepl-port] :as ctx}]

0 commit comments

Comments
 (0)