cygwin / vista中sbt的两个问题
我在 Windows Vista 上使用 cygwin 1.77。 我在 shell 中遇到 sbt
的输出问题。 一些相关的环境变量:
TERM=cygwin
CYGWIN=server
LANG=C.UTF-8
(1) 当我输入 sbt test
时,shell 包含很多不可打印的字符:
我该如何解决这个问题?
我的 sbt shell 脚本如下所示:
dir=`dirname $0`
stty -icanon min 1 -echo > /dev/null 2>&1
java -Djline.terminal=jline.UnixTerminal -Xmx512M -jar
`cygpath -w $dir`/sbt-launch-0.7.4.jar "$@"
stty icanon echo > /dev/null 2>&1
(2) sbt 命令找不到 scalatest jar &我不知道如何配置它通过ivy下载。如果我将 jar 放入 lib
文件夹中,它就会起作用。
I am using cygwin 1.77 on windows vista.
I'm facing problems with the output from sbt
in the shell.
Some relevant environment vars:
TERM=cygwin
CYGWIN=server
LANG=C.UTF-8
(1) When I type sbt test
the shell contains a lot of unprintable characters:
How can I fix this ?
My sbt shell script looks like this:
dir=`dirname $0`
stty -icanon min 1 -echo > /dev/null 2>&1
java -Djline.terminal=jline.UnixTerminal -Xmx512M -jar
`cygpath -w $dir`/sbt-launch-0.7.4.jar "$@"
stty icanon echo > /dev/null 2>&1
(2) The sbt
command cannot find the scalatest
jar & I don't know how to configure it to download it via ivy. It works if I drop the jar into the lib
folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于 1):
Cygwin 控制台的工作方式是 Cygwin DLL 的一部分将 Unix 终端控制序列映射到 Windows 控制台 API 调用。由于该终端仿真是 Cygwin DLL 的一部分,因此它不可用于非 Cygwin 程序(例如 Java 运行时)。相反,
java
将直接与 Windows 控制台对话,而 Windows 控制台不理解转义序列。因此它们直接出现在屏幕上。有几种方法可以解决这个问题:
(顺便说一句,
CYGWIN=server
选项已过时;它启用的功能无论如何都始终处于启用状态。)Regarding 1):
The way the Cygwin console works is that there's a part of the Cygwin DLL that maps Unix terminal control sequences to Windows console API calls. Since that terminal emulation is part of the Cygwin DLL, it is not available to non-Cygwin programs such as the Java runtime. Instead,
java
will be talking directly to the Windows console, which doesn't understand escape sequences. Hence they appear directly on screen.There are a few ways you could address this:
-Djline.terminal=jline.UnixTerminal
option would do that.CYGWIN=tty
option. With that, programs invoked in the Cygwin console have their I/O connected to a "pseudo terminal" (pty) device instead of being connected directly to the console window. This makes the terminal emulation features available to non-Cygwin programs, but it means that programs that use the Windows console API will no longer work correctly.(Btw, the
CYGWIN=server
option is obsolete; the feature that it enabled is always on anyway.)