How can I set the jline.terminal system property (so as not to fix echo while typing on cygwin mintty)?

I started using sbt on cygwin,

, but had an issue where my typing would not be reflected in console

.

Following this advice , sbt now echos for example:

$ sbt
[info] Loading project definition from D:\cygwin\home\Administrator\scala-2.11.2\coursera\example\project\project
[info] Loading project definition from D:\cygwin\home\Administrator\scala-2.11.2\coursera\example\project
[info] Set current project to progfun-example (in build file:/D:/cygwin/home/Administrator/scala-2.11.2/coursera/example/)
> ; eval System.setProperty("jline.terminal", "scala.tools.jline.UnixTerminal")
[info] ans: java.lang.String = jline.UnixTerminal
> console
[info] Starting scala interpreter...
[info] 
Welcome to Scala version 2.10.4 (Java HotSpot(TM) Client VM, Java 1.7.0_67).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import example.Lists._
import example.Lists._

scala> 

      

I tried to automate this fix by typing the line export SBT_OPTS="-Djline.terminal=scala.tools.jline.UnixTerminal"

in ~/.sbtconfig

, but I can't seem to use the correct syntax as the echo isn't working.

How do I get sbt console

for automatic use ; eval System.setProperty("jline.terminal", "scala.tools.jline.UnixTerminal")

?

+3


source to share


1 answer


There's so much to discover in sbt ...

> inspect initialize
[info] Setting: Unit = ()
[info] Description:
[info]  A convenience setting for performing side-effects during initialization.
[info] Provided by:
[info]  */*:initialize
[info] Defined at:
[info]  (sbt.Defaults) Defaults.scala:153
[info] Delegates:
[info]  *:initialize
[info]  {.}/*:initialize
[info]  */*:initialize
[info] Related:
[info]  */*:initialize

      

You can use initialize

which requires side effects to be executed during initialization. In ~/.sbt/0.13/default.sbt

you can do execution System.setProperty

:



initialize := {
  System.setProperty("jline.terminal", "scala.tools.jline.UnixTerminal")
}

      

When in sbt shell execute eval sys.props("jline.terminal")

to check this. It works fine in console

(when called sys.props

) << 27>.

+1


source







All Articles