Fork me on GitHub
#nrepl
<
2024-07-29
>
dominicm10:07:09

I've been trying to figure out why println isn't working, and this is thus far my minimal repro:

/private/tmp 10s
❯ clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.3.0-beta3"}}}'  -M -m nrepl.cmdline --interactive
nREPL server started on port 55989 on host localhost - 
nREPL 1.3.0-beta3
Clojure 1.11.3
OpenJDK 64-Bit Server VM 22.0.2
Interrupt: Control+C
Exit:      Control+D or (exit) or (quit)
user=> (future (Thread/sleep 1000) (println :hi))
#object[clojure.core$future_call$reify__8544 0x68ff66d0 {:status :pending, :val nil}]
user=> 
This never does a print. Without the future it works fine. Also works fine without nrepl. This seems to go all the way back to 0.4.0.

dominicm11:07:17

There's an attempt at sending the :out, but I guess the result is being ignored because the eval has completed, so the output just goes nowhere... It's a shame that there's no way to know the output is "unhandled" and therefore should at least print "regularly".

dominicm11:07:18

https://github.com/nrepl/nrepl/blob/958c05ff04cefeba0e79259d5275a6e0ff154d71/src/clojure/nrepl/cmdline.clj#L100-L104 I'm guessing actually the problem is that we need something like this running constantly, for anything outside of evaluations?

dominicm11:07:16

https://github.com/nrepl/nrepl/pull/356 Not sure this change makes sense, but it's my initial idea.