Fork me on GitHub
#cider
<
2023-01-20
>
pithyless08:01:47

I’m running doom-emacs with latest unpinned cider (I’ve upgraded after seeing the same behavior on cider 1.5.0). I can connect via cider-connect-clj to an nrepl running from the terminal. After evaling one or a couple of expressions (hard to reproduce the minimum number of operations) the repl buffer closes and I see [nREPL] Connection closed in *Messages* . It could also be a timing issue - maybe it just closes after ~1 minute. Does this ring a bell to anyone? Any tips on how I can debug this further?

pithyless08:01:06

This is on a new M1 macbook (in case that could be related); so I can’t say that it started happening after a certain upgrade, etc.

pithyless09:01:03

I think it may be related to doom workspaces.

daveliepmann10:01:04

Could the port be getting stomped by another process? And do you have https://docs.cider.mx/cider/troubleshooting.html#debugging-the-communication-with-nrepl turned on?

pithyless13:01:02

Thanks for following up; I’ve been struggling with this for a couple of days and I found a temporary workaround for now. It looks like this is somewhat related to doom-emacs (workspaces / doom / evil-mode / ???), such that it looks like some set of operations call evil-quit which then causes cider to disconnect after a short delay (presumably via cider-quit).

pithyless13:01:46

The workaround I discovered on doom-emacs discord is to switch the buffer repl and close it immediately:

(map! :map cider-repl-mode-map
       (:localleader
        "s" #'(lambda ()
                (interactive)
                (switch-to-buffer "*Messages*")
                (delete-window))))

pithyless13:01:38

This is the way I like to work anyway (with the actual repl buffer hidden), so it is not a problem for me. And for whatever reason, this approach works: the repl sits quietly in the background and cider does not disconnect.

daveliepmann14:01:30

👍:skin-tone-3: