nrepl

reefersleep 2025-06-27T11:41:43.165939Z

One of my colleagues is connecting from IntelliJ/Cursive to an nrepl server run in the terminal. Print output is seen only in the server process. I know that there's an issue about this; https://github.com/nrepl/nrepl/issues/119 But does someone here maybe know a hack that currently works, to redirect print output to the client?

reefersleep 2025-08-01T09:23:32.364239Z

Sorry, I didn't check the link at the time, and the thread slipped away from me. Thank you for the heads up! I'll keep this thread in mind if my colleague and I return to the issue ๐Ÿ™‚

๐Ÿ‘ 1
๐Ÿงก 1
cfleming 2025-06-27T11:55:48.632079Z

It depends on the type of print output - anything going through *out* (i.e. most Clojure I/O) will be relayed to the client, but directly using System.out/err will not (i.e. most Java output). There's no workaround to this that I'm aware of.

reefersleep 2025-06-27T12:11:34.919729Z

Thank you ๐Ÿ™‚ We'll have to look into where the output is going currently.

Ivar Refsdal 2025-06-27T13:08:20.969649Z

Did you check out the linked gist in the issue? https://gist.github.com/daviesian/4517859

Ivar Refsdal 2025-07-31T19:02:36.017899Z

I did a proof of concept for this at: https://github.com/ivarref/capture-sout-serr Details: https://github.com/nrepl/nrepl/issues/119#issuecomment-3141041830

Ivar Refsdal 2025-07-31T19:03:27.550869Z

If cursive uses nrepl.core/client-session in (a future release of) nrepl, I believe this (forwarding of System.out) should work there as well.