2016-12-02 194 views
0

下完成我不能運行在交互模式SBT任何命令,而如果在命令行中使用的相同命令的工作。 我正在SBT 0.13.13與Java在Babun Cygwin的Windows 7上1.8.0_102-B14。 我已經創建了一個最小的Scala項目,以解決其他sbt問題。 sbt可以編譯我的項目並且可以進入交互模式,但是它會被任何命令卡住。爲什麼/我該如何解決這個問題?SBT交互模式命令不Babun

{ sbtXmpl } > ./sbt projects 
+ java -jar ./build/buildcommon/sbt-launch.jar projects 
[info] Loading global plugins from C:\Users\MyName\.sbt\0.13\plugins 
[info] Loading project definition from C:\dev\sbtXmpl\project 
[info] Set current project to root (in build file:/C:/dev/sbtXmpl/) 
[info] In file:/C:/dev/sbtXmpl/ 
[info]  core 
[info] * root 
[info]  util 
{ sbtXmpl } > ./sbt 
+ java -jar ./build/buildcommon/sbt-launch.jar 
[info] Loading global plugins from C:\Users\MyName\.sbt\0.13\plugins 
[info] Loading project definition from C:\dev\sbtXmpl\project 
[info] Set current project to root (in build file:/C:/dev/sbtXmpl/) 
> projects 
// This never returns 
^C 
zsh: command not found: projects 
+0

其實,這可能更多的是使用Cygwin/Babun及其與Windows交互。我無法交互運行Python,但我可以運行「python SomeScript.py」 – radumanolescu

+0

是的。這看起來像你輸入('projects')未發送至'sbt',因爲'zsh'注意到它'sbt'被殺害後。這可能是比'sbt'更高的錯誤。 – jkinkead

回答

0

這可能涉及到一個控制檯Java應用程序(SBT)如何與外殼進行交互。 我是能夠解決的問題通過在我用來運行SBT腳本添加下面的代碼片段SBT:

if [ "$(expr substr $(uname -s) 1 6)" == "CYGWIN" ];then 
    #Ensure that sbt uses the correct terminal settings 
    CYG_OPTS="-Djline.terminal=jline.UnixTerminal -Dsbt.cygwin=true" 
    #Prevent erase, kill, werase, and rprnt special characters 
    stty -icanon min 1 -echo > /dev/null 2>&1 
fi 

#launch sbt 
java $CYG_OPTS $JAVA_OPTS -jar $SBT_LAUNCHER "[email protected]" 

我還沒有找到一個用於Python的解決方案。

REPL programs (sbt, python) do not complete under Babun

Babun breaks on winows apps with console input