cider icon indicating copy to clipboard operation
cider copied to clipboard

Consider changing dead repl prompt text

Open lread opened this issue 4 years ago • 7 comments

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:

  1. laziness in not looking up what this prompt means
  2. 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

lread avatar Oct 19 '21 22:10 lread

Relatedly, could we reduce choice via a defcustom?

Generally users expect things to 'just work' aka Don't Make Me Think :)

vemv avatar Oct 19 '21 22:10 vemv

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).

lread avatar Oct 19 '21 22:10 lread

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).

bbatsov avatar Oct 20 '21 07:10 bbatsov

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

plexus avatar Oct 20 '21 09:10 plexus

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?

  1. prompt as it does today (with updated text, of course)
  2. automatically answer y and reuse the dead buffer
  3. 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".

lread avatar Oct 20 '21 15:10 lread

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.

lread avatar Oct 26 '21 22:10 lread

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

vemv avatar Oct 26 '21 23:10 vemv