Search code examples
scalasbtterminate

SBT stop run without exiting


How do you terminate a run in SBT without exiting?

I'm trying CTRL+C but it exits SBT. Is there a way to only exit the running application while keeping SBT open?


Solution

  • In the default configuration, your runs happen in the same JVM that sbt is running, so you can't easily kill them separately.

    If you do your run in a separate, forked JVM, as described at Forking, then you can kill that JVM (by any means your operating system offers) without affecting sbt's JVM:

    run / fork := true