Fix repl in interactive task.
Still a bit of a mystery why we need an extra keypress after exiting the repl.
This commit is contained in:
parent
e56e201019
commit
ee9932ad11
2 changed files with 5 additions and 3 deletions
|
@ -50,6 +50,9 @@
|
|||
(let [[task-name & args] (string/split input #"\s")]
|
||||
;; TODO: don't start a second repl server for repl task
|
||||
(try (apply-task task-name project args not-found)
|
||||
;; TODO: not sure why, but repl seems to put an extra EOF on *in*
|
||||
(when (= "repl" task-name)
|
||||
(.read *in*))
|
||||
(catch Exception e
|
||||
(println (.getMessage e))))
|
||||
(print-prompt)
|
||||
|
@ -67,6 +70,6 @@
|
|||
(let [connect #(poll-repl-connection port 0 vector)]
|
||||
(binding [eval-in-project (partial eval-in-repl connect)
|
||||
*exit-after-tests* false
|
||||
exit (fn [_] (println "\n"))]
|
||||
exit (fn exit [& _] (prn))]
|
||||
(task-repl project)))
|
||||
(exit)))
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
(.start (Thread. #(copy-out-loop reader)))
|
||||
(loop [reader reader, writer writer]
|
||||
(let [input (read-line)]
|
||||
;; TODO: ^D is not being honored
|
||||
(when (and input (not= "" input))
|
||||
(.write writer (str input "\n"))
|
||||
(.flush writer)
|
||||
|
@ -137,4 +136,4 @@ Running outside a project directory will start a standalone repl session."
|
|||
(clojure.main/with-bindings (println (eval server-form)))
|
||||
(eval-in-project project server-form)))
|
||||
(poll-repl-connection port retries repl-client)
|
||||
0)))
|
||||
(exit))))
|
||||
|
|
Loading…
Reference in a new issue