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

interrupting the repl #2068

Closed
seebs opened this issue Feb 8, 2023 · 8 comments
Closed

interrupting the repl #2068

seebs opened this issue Feb 8, 2023 · 8 comments
Labels
developer ergonomics documentation Better documentation needed. good first issue Good for newcomers

Comments

@seebs
Copy link

seebs commented Feb 8, 2023

If you are a newbie to clojure, it's easy to accidentally write something that becomes an infinite loop. If you try to evaluate it in the repl... Now what? Some REPLs apparently allow ^C to interrupt an evaluation, without killing the entire REPL process and losing its context. I can't tell whether Calva does, but if it does, I couldn't find out how by looking in the documentation.

It feels to me like "how do I stop this" should be prominent in the documentation, we've been having problems with runaway processes since Fantasia. :)

@PEZ PEZ added good first issue Good for newcomers documentation Better documentation needed. developer ergonomics labels Feb 8, 2023
@PEZ
Copy link
Collaborator

PEZ commented Feb 8, 2023

Thanks for pointing this out, @seebs! You are very welcome to have a look at the documentation and REPL Ux, and file PRs addressing this.

Some things to consider for you (or anyone taking it on):

  • There indeed is a way to interrupt runaway evaluations. The VS Code command: Calva: Interrupt Running Evaluations. It's default bindings are ctrl+alt+c ctrl+alt+d (so you can hold ctrl+alt/option while pressing c, then d).
  • ctrl+c isn't really free, as it is used for Copy on Windows and Linux. Also, as a user you might think it kills the REPL. (Which it does if you use Jack-in and press ctrl+c in the Jack-in terminal.)
  • Information about how to interrupt evaluations could be added to the REPL greetings.
  • The REPL statusbar item brings up a menu. This menu could be a place to discover this command.

Cheers!

@seebs
Copy link
Author

seebs commented Feb 8, 2023

Thanks! I did in fact look in the docs for "interrupt" a bit, but apparently I did not look in them enough.

@PEZ
Copy link
Collaborator

PEZ commented Feb 8, 2023

I don't think it is mentioned in the docs. You should have searched the command palette instead. 😄

@seebs
Copy link
Author

seebs commented Feb 9, 2023

Huh. I do "calva: inte" in the command palette and don't get any matches. Calva claims to be version v2.0.331, if that matters.

@PEZ
Copy link
Collaborator

PEZ commented Feb 9, 2023

I'm guessing you haven't connected a REPL. Otherwise we might have a bug.

@seebs
Copy link
Author

seebs commented Feb 9, 2023

! Right you are. I suspect I broke it, sent a SIGINT to the process because someone said ^C had worked in something else so I thought "oh, maybe it traps sigint", then searched the palette for "interrupt", didn't find it, restarted the repl...

@bpringe
Copy link
Member

bpringe commented Feb 12, 2023

@PEZ Might the interrupt command be a good thing to include in the Getting Started REPL? It could include some code that when evaluated, doesn't terminate, and then instruct the user to run the interrupt command.

@PEZ
Copy link
Collaborator

PEZ commented Feb 12, 2023

@bpringe Indeed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer ergonomics documentation Better documentation needed. good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants