exiting the repl console with a background process

Lee Mighdoll picture Lee Mighdoll · Nov 18, 2011 · Viewed 11.7k times · Source

How do you exit from the repl console in sbt with a background process running? The following hangs:

$ sbt
> console
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26).

scala> import scala.sys.process._
import scala.sys.process._

scala> "sleep 10000".run
res0: scala.sys.process.Process = scala.sys.process.ProcessImpl$SimpleProcess@67219b8c

scala> <ctrl-d entered>
...hangs

ctrl-c works, but kills sbt too. I suppose I'm looking for a letter between ctrl-c and ctrl-d.

Answer

Vasil Remeniuk picture Vasil Remeniuk · Nov 18, 2011

Enter :q to quit the console (it will lead to some sort of hanging), and, then, ctrl+c.