我真的想sbt和它的控制台工作在cygwin任何方式你认为可以做到吗? [英] i really would like sbt and its console to work under cygwin any way you think it can be done?

查看:418
本文介绍了我真的想sbt和它的控制台工作在cygwin任何方式你认为可以做到吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题( https://github.com/sbt/sbt/issues/562)基本上当我尝试获得一个控制台它说:

i have this issue (https://github.com/sbt/sbt/issues/562) basically when I try to get a console it says:

[错误]无法构造终端;返回unsupportedjava.lang.IllegalArgumentException:无效的终端类型:jline.UnixTerminal

[ERROR] Failed to construct terminal; falling back to unsupportedjava.lang.IllegalArgumentException: Invalid terminal type: jline.UnixTerminal

也不能使用退格

你基本上不能在cygwin中使用sbt(在dos是好的,但cygwin是一个更好的环境)
并已表示我的关注

you basically cannot use sbt in cygwin (in dos is fine but cygwin is a much nicer environment) and have voiced my concern there

解决方法我在网上找到,但他们都是旧版本,现在没有使用

i have tried several workaround i found on the net but they are all for old releases and no use now

只是想知道你是否知道任何解决方法?

was just wondering if you know of any workaround?

感谢

推荐答案

以下适用于我(主要参见底部的注释):

The following works for me (mostly, see note at bottom):


  1. 使用mintty shell。我相信这是新的cygwin安装的默认shell,但已被包括作为一个替代的一段时间。如果mintty.exe存在于您的< cygwin home> \bin 文件夹中,那么它就可以使用,否则可以通过安装中典型的cygwin软件包安装。 exe。

  2. 打开一个mintty窗口,右键单击任何地方,转到选项... - > ,并确保发送退格为^ H 已选中。这将允许REPL正确解释后空格。

  1. Use the mintty shell. I believe this is the default shell for new cygwin installs but has been included as an alternative for a while. If mintty.exe exists in your <cygwin home>\bin folder then it's ready to use, else it can be installed through the typical cygwin package selection from the setup.exe.
  2. Open a mintty window, right click anywhere, go to Options... -> Keys, and make sure Send Backspace as ^H is checked. This will allow the REPL to correctly interpret backspaces.

只是运行Scala REPL,这应该是你需要的, sbt console 仍然可以产生该异常。要过去,请运行 sbt ,不带任何参数,以进入sbt提示符。从那里执行:

For just running the Scala REPL that should be all you need, but attempting to run sbt console can still produce that exception. To get past that, run sbt without any arguments to get to the sbt prompt. From there execute:

eval System.setProperty("jline.terminal", "scala.tools.jline.UnixTerminal")

然后

console

或者,作为单个命令(两个分号都很重要) / p>

or, as a single command (with both semi-colons being important):

; eval System.setProperty("jline.terminal", "scala.tools.jline.UnixTerminal") ; console



从我可以知道,这至少是部分由Scala REPL和sbt提示符使用不兼容版本的JLine。特别是,它看起来像Scala REPL在库周围创建自己的包装器,并且正在使用,而sbt直接使用JLine库。


From what I can tell, this is caused at least in part by the Scala REPL and the sbt prompt using incompatible versions of JLine. In particular, it looks like the Scala REPL created their own wrappers around the library and are using that while sbt is using the JLine library directly.

我继续遇到的一个限制是REPL在第80列包装,即使shell窗口有更多的水平空间。不仅如此,但是当REPL如此覆盖时,它会覆盖同一行而不是前进到下一行,并且从历史记录中拉长行会将光标移动到您实际编辑的行上方。

One limitation that I continue to run into is that the REPL wraps at column 80 even if the shell window has more horizontal space. Not only that, but when the REPL wraps like this it overwrites the same line rather than advancing to the next, and pulling long lines from history ends up pushing the cursor above the line you're actually editing.

这篇关于我真的想sbt和它的控制台工作在cygwin任何方式你认为可以做到吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆