scala 使用后台进程退出 repl 控制台

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8188861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 03:40:29  来源:igfitidea点击:

exiting the repl console with a background process

scalasbtread-eval-print-loop

提问by Lee Mighdoll

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

如何在后台进程运行的情况下退出 sbt 中的 repl 控制台?以下挂起:

$ 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.

ctrl-c 有效,但也会杀死 sbt。我想我正在寻找 ctrl-c 和 ctrl-d 之间的字母。

回答by Vasil Remeniuk

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

Enter:q退出控制台(它会导致某种挂起),然后,ctrl+c.