简体   繁体   中英

calva - how to stop the repl?

I'm using vs code with calva on Ubuntu. My clojure app listens on a port and I find that if I exit vs code, it leaves a java process bound to that port which I have to locate and kill before I can start again.

Is there any calva command to stop the repl?, or better still, a way of stopping the repl automatically when I exit vs code?

You are right to expect that the process (if started by Calva) should be owned by Calva/VS Code and that exiting VS Code should kill it. Please report this as a bug on Calva: https://github.com/BetterThanTomorrow/calva This works on MacOS (and I think on Windows too) so please report this from VS Code's help menu so that your system info gets attached.

As for how to kill the REPL. You can press Ctrl+C in the terminal where the process is started. We should add a proper command for it as well, but that's for another day. (That it gets killed when you disconnect the REPL is a also a bug, I would say.)

From the comments I've figured out that I was really asking the wrong question. I was under the impression that the repl was "owned by" to the vs code process that started it and that not terminating it when you quit vs code was a bug, but really my understanding wasn't right.

So to solve my original problem of leaving a process bound to the port, there are 3 options:

  1. Terminate the repl using clojure (System/exit 0)
  2. Use the calva command to reconnect to the existing repl after restarting vs code
  3. Use calva to disconnect from the repl, then you have the choice of starting a new one (which automatically will kill the old one) or re-connecting later

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM