> https://clojurians.slack.com/archives/C17JYSA3H/p1713102482119679?thread_ts=1713032441.875029&cid=C17JYSA3H what is "session-closed", why do I need to send it to make vim-fireplace believe the session is closed, where is this documented?
https://github.com/nrepl/nrepl/blob/master/src/clojure/nrepl/middleware/session.clj#L348
it's middleware so not part of the nREPL spec per se, I guess?
yeah, but it is a pretty ancient part of nrepl, so wouldn't be surprised if everything just assumes it is there
got it, thanks
The session middleware is the foundational part of nrepl, so it's not optional. Everything depends upon it, including eval.
I'm coming at this as an implementor of a non JVM Clojure nREPL server. If something is essential, it should imo be documented as part of the protocol
PRs are welcome :)
But it is documented - https://nrepl.org/nrepl/1.3/ops.html#close
There’s no “session-closed” per se - you use “clone” to create a session and “close” to destroy it.
Ok so when a client relies on “session-closed” that’s not according to the spec then right? Why even send this value then?
I guess that’s legacy, as it’s the first time I hear about it.
Fireplace was an early adopter of nREPL. Let me check the code myself.
I see that the success response for close is the set {:done :session-closed} and I guess that’s the part we failed to document properly. Seems reasonable for the clients to check that a session actually got closed.
Funny enough, I never bothered to check for this in CIDER and I just assume that if the response had :done in it the session got closed, which is not great, as you can get a “done” together with some error.
yeah, I've never ran into this except for vim fireplace :)
ok great we cleared this up, thanks @bozhidar!
I created an issue for it at least now: https://github.com/nrepl/nrepl/issues/376
Thanks!