scala sbt 清屏命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16734804/
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
sbt clear screen command
提问by ajduke
I am learning sbtbuild tool. I use interpreted sbt. I run lot of commands and get lot of output which clutters up the screen.
我正在学习sbt构建工具。我使用解释的sbt. 我运行了很多命令并获得了大量输出,这些输出使屏幕变得混乱。
The question is any command for clear screen for sbtinterpretive console , like clsin DOS shell or clearin bash
问题是用于sbt解释性控制台的清除屏幕的任何命令,例如cls在 DOS shell 或clearbash 中
My googling skill did not helped
我的谷歌搜索技能没有帮助
update : i am using console2with windows power shell
更新:我使用console2同windows power shell
回答by drexin
In bash you should be able to use Ctrl+L, on OSX you can also use Cmd+K.
在 bash 中你应该可以使用 Ctrl+L,在 OSX 中你也可以使用 Cmd+K。
回答by Matt Hughes
This specifically helps when you're doing something in continuous mode, ala `compile:
当你在连续模式下做某事时,这特别有帮助,ala `compile:
maxErrors := 5
triggeredMessage := Watched.clearWhenTriggered
This works as of 0.13.7. The second line clears the screen before each command runs. The first line limits the number of errors. With this config, you only ever have one screen full of errors to work through. Obviously could adjust maxErrors depending on your sbt window.
这适用于 0.13.7。第二行在每个命令运行之前清除屏幕。第一行限制了错误的数量。使用此配置,您只有一个充满错误的屏幕需要处理。显然可以根据您的 sbt 窗口调整 maxErrors。
回答by Guillaume Massé
Sbt will load ~/.sbt/1.0/build.sbtas global settings.
Sbt 将~/.sbt/1.0/build.sbt作为全局设置加载。
commands += Command.command("cls") { state =>
print("3c")
state
}
Then you can run any commands with cls. For example:
然后你可以使用 cls 运行任何命令。例如:
~;cls;compile~;cls;testOnly
~;cls;compile~;cls;testOnly

