cursive
cursive copied to clipboard
Shutdown hooks don't run in REPL
When using the REPL, I would expect Stop REPL
or Close REPL Tab
to shut down the REPL JVM gracefully, running any shutdown hooks as appropriately.
Example:
(.addShutdownHook (Runtime/getRuntime) (Thread. ^Runnable (fn [] (println "shutdown")) "shutdown"))
When run in a Clojure REPL or Leiningen nREPL, the JVM will print shutdown
before it terminates.
When run in Cursive's REPL nothing is printed when Stop REPL
is pressed. If you end the process by calling (System/exit 0)
the hook does run, so it is being registered successfully.
Maybe relevant: https://stackoverflow.com/a/4727696/1209442
This issue is relevant because it prevents File/deleteOnExit
hook from running, which leaks temporary files (e.g. test output).
Having the same issue here (5 years on). Temurin 17 JDK, OS X 12.3, IntelliJ Ultimate 2021.3.2, Cursive 1.12.1-2021.3