cider

plexus 2026-02-16T14:27:25.799929Z

I no longer seem to be able to disable CIDER's interception of *out*

plexus 2026-02-16T14:28:02.917839Z

I thought this should do it, but my println's are still going to the REPL buffer, not to the process stdout

(setq cider-redirect-server-output-to-repl nil)

plexus 2026-02-16T14:28:14.662349Z

any ideas?

plexus 2026-02-16T14:29:37.748069Z

I ended up with the old workaround

(binding [*out* (io/writer System/out)]
  (println ...))

Michael Griffiths 2026-02-16T15:09:01.764199Z

setting that var should do it – IIRC it has to be set before you cider-connect

Michael Griffiths 2026-02-16T15:11:22.654669Z

I had a similar issue a while back and I worked around it at the time by doing something like this at the REPL:

(cider.nrepl.middleware.out/unsubscribe-session (:session nrepl.middleware.interruptible-eval/*msg*))
It works for me now though using [nrepl "1.5.2"] and [cider/cider-nrepl "0.58.0"] Maybe confirm your cider/cider-nrepl/nrepl versions?

πŸ‘ 1
plexus 2026-02-16T15:16:00.701899Z

yeah that's fair, I'm probably out of date. I did restart my repl after setting the variable

Michael Griffiths 2026-02-16T15:16:42.149499Z

I don't know if/when anything around this has changed recently though. It's definitely a long while since I had an issue with it

Michael Griffiths 2026-02-16T15:22:08.763539Z

Had a quick look and the relevant client/middleware code both haven't changed in ~years. Just to check – your printing code is relying on some load-time captured value of *out*?

Michael Griffiths 2026-02-16T15:23:03.548489Z

If you're just using e.g. println at the REPL and you want the output to go somewhere else then the relevant setting is cider-interactive-eval-output-destination

plexus 2026-02-16T15:27:38.782339Z

I was just doing a bare println, in particular inside an add-watch. Some of the output would go to the REPL buffer, some to the terminal where clojure is running.

plexus 2026-02-16T15:28:04.735729Z

thanks for looking into it, the workaround works for now.

πŸ‘ 1
Michael Griffiths 2026-02-18T14:46:56.457219Z

ah, I thought the client wasn't using the new forward-system-output op from there yet

bozhidar 2026-02-18T15:04:57.677449Z

Hmm, now I started to wonder whether you might be right, as I don’t recall if we made the change already or not. πŸ˜… I’ll have to consult the code.

bozhidar 2026-02-18T07:52:54.124399Z

I'm guessing you're seeing the impact of https://github.com/nrepl/nrepl/pull/393

bozhidar 2026-02-18T07:53:28.168639Z

We've been gradually upstreaming some things from cider-nrepl to nrepl.

πŸ‘ 1
oyakushev 2026-02-19T11:05:24.507719Z

Hello Arne! Please specify, do you need to disable redirecting of *out* or System/out?

plexus 2026-02-19T12:26:18.636079Z

*out*, I want my printlns to go to my terminal (jvm process stdout), and not to nREPL/CIDER/`*cider-repl*`. It seems System/out is not being intercepted, hence why binding [*out* (io/writer System/out)] works as a workaround

oyakushev 2026-02-19T13:05:52.865269Z

And (setq cider-redirect-server-output-to-repl nil) used to prevent *out* being redirected, right? And it no longer does?

Michael Griffiths 2026-02-19T19:49:43.679589Z

if you're using add-watch then I wonder if sometimes the watch is being called with the load-time binding of *out* (either something captures its value at load time or maybe it's called from a non-nrepl thread) and sometimes with a REPL-time binding of *out*