Welcome! Please see the About page for a little more info on how this works.

+1 vote
in REPL by
When the in-reader passed to {{clojure.core.server/remote-prepl}} reaches end-of-stream, an attempt is made to close the socket's reader. This however blocks the main-thread as (mostly) the socket is still being read from.

{code:none}
$ clj -J-Dclojure.server.jvm="{:port 5555 :accept clojure.core.server/io-prepl}" -r
Clojure 1.10.0
user=> (clojure.core.server/remote-prepl "127.0.0.1" 5555 *in* prn)
;; as expected:
1
{:tag :ret, :val 1, :ns "user", :ms 0, :form "1"}
^D ;; hangs - ^C required to exit process


What I would expect to happen in this case is that upon {{^D}} the initial repl re-appears (similar to how {{(clojure.core.server/io-prepl)}} behaves).

What does work:
{code:none}
$ clj -J-Dclojure.server.jvm="{:port 5555 :accept clojure.core.server/io-prepl}" -r
Clojure 1.10.0
user=> (clojure.core.server/remote-prepl "127.0.0.1" 5555 *in* prn)
:repl/quit
^D
nil
user=> _


Looking at the code though it seems that this is not the intented way to terminate the prepl.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2509 (reported by alex+import)
...