如何使用mingw和sbt在windows上获得specs2颜色支持 [英] how to get specs2 color support on windows using mingw and sbt
问题描述
我使用Git Bashgit的mingw控制台在Windows上使用SBT运行Specs2测试。 mingw控制台具有颜色支持,但我的specs2测试不会以彩色显示。我怎样才能让我的mingw,sbt,specs2,windows安装程序以彩色显示测试?
I am using "Git Bash" git's mingw console to run Specs2 tests using SBT on Windows. The mingw console has color support but my specs2 tests do not display in color. How can I get my mingw, sbt, specs2, windows setup to display tests in color?
我尝试在build.sbt配置中添加以下选项,但它确实
I tried adding the following options to my build.sbt configuration, but it did not change anything.
testOptions in Test += Tests.Argument("jline.terminal","jline.UnsupportedTerminal")
谢谢
Thanks
推荐答案
通过下载Cygwin并使用mintty终端而不是Git Bash以及以下脚本,我能够实现这一目标。然而,虽然这使我获得了specs2的颜色,但我失去了git的颜色。但至少我现在有一个可调整大小的终端。
I was able to get this working by downloading Cygwin and using the mintty terminal instead of "Git Bash", along with the following script. However while this gained me color for specs2 I lost color for git. But at least I have a resizable terminal now.
#!/bin/sh
#must be saved with unix line endings
#setup for using sbt with cygwin's mintty terminal (gets you colored specs2 tests)
BASEDIR=$(dirname $0)
stty -icanon min 1 -echo > /dev/null 2>&1
java -Djline.terminal=jline.UnixTerminal -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar `cygpath -m $BASEDIR/sbt-launch.jar` "$@"
stty icanon echo > /dev/null 2>&1
这篇关于如何使用mingw和sbt在windows上获得specs2颜色支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!