Skip to content
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

Document ctrl+d to exit REPL #245

Open
pfiaux opened this issue Sep 8, 2022 · 2 comments
Open

Document ctrl+d to exit REPL #245

pfiaux opened this issue Sep 8, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@pfiaux
Copy link
Contributor

pfiaux commented Sep 8, 2022

Describe the bug
I couldn't get out out of the REPL after running bass 🙈, I usually ended up closing that terminal session and letting my shell handle it. I tried all sorts of things I'm used to:

  • ctrl+c
  • exit (exit) (exit 1)
  • quit
  • system.exit, process.exit, ...
  • (error)

Eventually I was looking up how to get out of a LISP REPL and found https://stackoverflow.com/a/4982226/891965.

To Reproduce
n/a

Expected behavior
I felt I was missing 2 things:

  • Some part of the docs or getting started mentioning how to close/exit the REPL
  • Some hint when running exit commands common to other environments (exit or ctrl+c) that to exit one should use ctrl+d

For example the python3 REPL does this:

⟩ python3
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit

I realize this might not be a common problem, if you disagree we can close this 👍. Searching for exit or REPL in the issues will turn this up if someone else gets stuck where I did it would already help.

Additional context
There's probably some language background to this, probably this is obvious to those who use some tools or some languages. I mostly do go, nodejs, bash, fishshell but ctrl+d wasn't something I thought of.

@pfiaux pfiaux added the bug Something isn't working label Sep 8, 2022
@vito
Copy link
Owner

vito commented Sep 8, 2022

Yeah, this is something I take for granted. :) Happy to make this more ergonomic.

Traditionally Ctrl+C doesn't exit out of a REPL because it's also used to bail out of the current input and start over. Maybe we could detect when Ctrl+C is pressed with an empty input and print a helpful message.

Or maybe bass could just print some useful things on start?

⟩ bass
Playing Bass v0.10.0.
Use (doc foo) to print the docs for foo. Use Ctrl+D to exit.
=> 

Not really wedded to a particular solution, but this is definitely valid. More ideas welcome.

@pfiaux
Copy link
Contributor Author

pfiaux commented Sep 10, 2022

Print on start would work, happy to work on a PR after I finish the one I already started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants