Fork me on GitHub
#cider
<
2024-02-07
>
jumar08:02:13

Can I automatically avoid using a dead repl buffer and kill it every time I do cider-connect? I found cider-reuse-dead-repls which I could customize (set to nil?) but it seems it doesn't kill the dead buffers.

magnars08:02:41

How does your repl buffers die? I use C-s C-q which quits and kills the buffers.

jumar13:02:03

I run the repl in a terminal and then connect to it from cider-connect. To terminate I simply interrupt the repl process inside the terminal.

practicalli-johnny18:02:33

Ideally disconnect Emacs Cider from the external REPL started in the terminal, before terminating the REPL process in the terminal. This will avoid a 'dead' repl connection. sesman-quit emacs command Or , m q q Spacemacs key binding The dead REPL is simply a CIDER connect that has lost its repl. So you can safely use a dead repl as the state is only what the terminal REPL state has.

practicalli-johnny18:02:41

Or you could automattically reuse any relevant repls in the Emacs config or a .dir-locals.el for a specific project

(setq cider-reuse-dead-repls 'auto)

Hans Conrad20:02:44

FYI.. as of more recent versions, the repl will ask you if you want to delete the "dead" repl if you chose to create one.

jumar03:02:24

Yes, I know and that’s what I would like to do automatically

Hans Conrad10:02:58

ah apologies 😉 I just recently updated and saw this change. This new change worked for me. I had this little helper function that would just remove all cider repl buffers before connecting to clean up any unused once before I reconnected.