calva icon indicating copy to clipboard operation
calva copied to clipboard

Calva should auto-connect to existing REPL instead of auto-jack-in

Open seancorfield opened this issue 1 year ago • 2 comments

When auto-connect and auto-jack-in options are enabled, and REPL connect sequences provided, if you jack-in to start a REPL and then reload the VS Code window, Calva should auto-connect after the reload, instead of trying to auto-jack-in.

In general, if auto-connect (and auto-jack-in) are enabled, and an existing .nrepl-port file is present, auto-connect should be attempted first (and for bonus points, only if that fails should it auto-jack-in).

See thread on Slack for background: https://clojurians.slack.com/archives/CBE668G4R/p1727118825831329

seancorfield avatar Sep 23 '24 19:09 seancorfield

Thanks for the report. We can't really make the jack-in repl survive a reload of the VS Code window. VS Code kills it because it's spawned by the VS Code window process.

However, if the repl is started in an integrated terminal, it will survive the reload. And then we can check for an existing repl before carrying out the auto-jack-in, and do auto-connect instead.

PEZ avatar Sep 23 '24 19:09 PEZ

FWIW, I've changed my workflow recently (again!) and instead of relying on (auto) jack-in, I now start a REPL manually (I have a repl script on my path that starts a combined REPL based on my dot-clojure stuff) and that survives reloads because VS Code just treats it as an existing terminal process. I've disabled auto jack-in but left auto connect in place, so after a reload Calva will connect back to the repl process running in the terminal. Works great and is less of an inconvenience than having the REPL restarted each time a reload occurs (auto jack-in).

TL;DR: this is very low priority for me now.

seancorfield avatar Dec 14 '24 21:12 seancorfield

Closing this out as too low priority to care.

seancorfield avatar May 19 '25 00:05 seancorfield