-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 5114 - Add greeting and Ctrl-V help to REPL #5159
base: main
Are you sure you want to change the base?
Conversation
Just a preference — but I generally prefer no "greeting" on my command-line tools. If you use them regularly, it gets old incredibly fast. |
Reasonable. If someone wants to know more about the tool they can check |
The downside to removing the greeting is that it's pretty non-obvious that CTRL-V exists at all. (I learned of it only a few weeks ago, after years of CoffeeScript.) Without some greeting, this doesn't fix #5114. Would a shorter greeting be reasonable? Alternatively, we can look for a more documentation-based fix as suggested in this comment. |
So what does this PR do now? Show a hint about Ctrl-V once the user already presses Ctrl-V, to tell them to repeat the key combination to turn off multiline mode? If someone already knows about Ctrl-V to enter multiline mode, wouldn’t they also know how to toggle it back off? |
Yes. First time they enter it each REPL session.
Certainly shouldn't take more than a few seconds to figgure it out. At least that's how I remember it. Btw, this addition from line 5 is redundant: |
Hello this is open since 2019 and all check have passed. Is there any specifics reasons to not merge it ? |
There are some usability concerns raised on this thread that I don't think have yet been addressed. One further one is, how does the regular Node REPL handle this and can we take the same approach? |
Even though I'm the author of this PR, I find the comments of @jashkenas and @GeoffreyBooth compelling and am in favor of keeping the REPL quiet. It is more in line with The Unix Way. |
So should we close this PR and the accompanying issue? We can always reopen if there’s a proposal for a UX that everyone’s happy with. |
Yes, and #5114. |
Just a 2 cents here, but wouldn't it be good to include these messages to ease newbie usage? Having to google something esoteric three seconds after using it seems like a non-starter for a lot of people. Python is a great example of tons of usage and still including the messages for their repl. |
+1 for the original version of this PR (as documented in the original post). I use CoffeeScript every day, but I use the REPL pretty rarely, and I still struggle to remember the right key for CTRL-V. So I think it would help veterans too, not just new users. I don't see the message being annoying; it's pretty short. Maybe folks would be happier if there were an environment variable and/or a command-line option to disable it? |
An implementation of #5114.
The REPL now starts with a greeting:
And the first time the user presses Ctrl-V they get a reminder to press it again to leave multi-line mode:
In the example above, the multi-line prompt after
undefined
demonstrates that thecoffee>
prompt was changed in-place the second time, just like the original behavior.I didn't add any tests since this is essentially a cosmetic change. I also only did enough testing to make sure it did what I expected on NodeJS versions 6 and 11.
Is there a better place to put UI strings such as the greeting and hint? (I'm used to having them kept in non-code files elsewhere in projects, like
${PROJECT_ROOT}/data/messages
.)