cider
cider copied to clipboard
Consider changing dead repl prompt text
Thanks! First, thank you for cider. It is magnificently useful and I so appreciate all the hard work!
Is your feature request related to a problem? Please describe.
For a while I have been mystified by the dead REPL prompt, an example:
A dead REPL *cider-repl borkdude/api-diff:localhost:60172(clj)* exists. Reuse? (y or n)
I did not understand what it was asking me to reuse. At one point I thought it might be a process. I know, so naive! Sometimes I answered y, other times n. When I finally took the time to look it up, I learned I am being asked if I want to reuse a buffer. A buffer! Oh!
I can't imagine I'm alone in my:
- laziness in not looking up what this prompt means
- being confused by this
Describe the solution you'd like
Include the word buffer after Reuse:
A dead REPL *cider-repl borkdude/api-diff:localhost:60172(clj)* exists. Reuse buffer? (y or n)
Describe alternatives you've considered None
Additional context None
Relatedly, could we reduce choice via a defcustom?
Generally users expect things to 'just work' aka Don't Make Me Think :)
Oh yeah, had not thought of that option, that'd work too @vemv! (If you mean just answer for me, I'm ok with what you choose).
I'm fine with both improving the message and adding a defcustom for it. Still, I think the defcustom should prompt by default, as I can imagine there are cases where you don't want to recycle the old REPL buffer (e.g. you started jack-in in the wrong project and you realized this only when you saw this message).
This message has never not annoyed me, and I always figure out some way to not have it show up. I never want to reuse an old repl buffer. I'd be more interested in some option to automatically clean things up, either by deleting the repl and related buffers when the process goes away, or to remove them automatically when doing a jack in in the same project.
When I do see this message what I usually do is
- curse that I didn't clean things up
- cancel the jack in
- look for cider buffers and delete them
- jack in again
So it seems that changing the text is uncontroversial. Adding a defcustom is also agreed on as a good thing.
What's undecided?
How should the default defcustom behave?
- prompt as it does today (with updated text, of course)
- automatically answer y and reuse the dead buffer
- automatically answer n, preserve the dead buffer and create a new one
To me, option 1 seems reasonable. Existing users won't be surprised by a change in flow, and annoyed/confused users can now configure the behaviour to 2 or 3.
@plexus, you raise some interesting ideas around auto-cleanup, do you agree that this could be explored as a separate issue?
I'd be happy to take a crack at a PR seeing this has been assessed as a "good first issue".
Actually, as I use cider today and am getting asked this question, it still might be confusing even with the addition of the word "buffer".
My original proposal:
A dead REPL *cider-repl borkdude/api-diff:localhost:60172(clj)* exists. Reuse buffer? (y or n)
What action my answer will carry out is not clear.
My new proposal:
A dead REPL *cider-repl borkdude/api-diff:localhost:60172(clj)* exists. Reuse buffer? y) append to existing n) preserve existing and start in new (y or n)
It might be on the verbose side, but I think it is much clearer.
SGTM, as https://github.com/clojure-emacs/cider/issues/3076#issuecomment-947794072 does!
It never hurts to start small, auto-cleanup can be implemented separately.
How should the default defcustom behave?
Ask, since bbatsov suggested so here: https://github.com/clojure-emacs/cider/issues/3076#issuecomment-947407042