Closed tpolecat closed 6 years ago
I think it's sbt issue, not TLS. Upgrading sbt to 1.1.4 fixed the problem for me.
Hm that doesn't fix it for me.
Yeah, I also see this with 1.1.4.
This is very strange. I can't think of any reason why TLS 2.12.4 would differ from LBS 2.12.4 wrt JLine.
So, I originally saw this in my work project and isolated it to TLS. The minimal example above demonstrated it (and still does, even with sbt 1.1.4).
However we just switched our work project back to LBS (in part due to this issue) and the problem is still there! So there's some other interaction introduced by a plugin or something that's triggering this issue. I'll investigate.
I'm losing my mind. Now LBS consistently shows the JLine bug for me but it was working moments ago. There's something very fishy going on and i have no idea where to look.
foo$ tree
.
├── build.sbt
└── project
└── build.properties
1 directory, 2 files
foo$ cat build.sbt
scalaVersion := "2.12.5"
foo$ cat project/build.properties
sbt.version=1.1.4
foo$ sbt
[info] Loading global plugins from /Users/rnorris/.sbt/1.0/plugins
[info] Loading project definition from /private/tmp/foo/project
[info] Updating ProjectRef(uri("file:/private/tmp/foo/project/"), "foo-build")...
[info] Done updating.
[info] Loading settings from build.sbt ...
[info] Set current project to foo (in build file:/private/tmp/foo/)
[info] sbt server started at local:///Users/rnorris/.sbt/1.0/server/b2c7b08bb0a88ab6cd9f/sock
sbt:foo> console
[info] Updating ...
[info] Done updating.
[info] Starting scala interpreter...
Welcome to Scala 2.12.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_144).
Type in expressions for evaluation. Or try :help.
scala> 1
res0: Int = 1
scala>
[success] Total time: 6 s, completed Apr 20, 2018 10:21:43 AM
sbt:foo> console
[info] Starting scala interpreter...
Welcome to Scala 2.12.5 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_144).
Type in expressions for evaluation. Or try :help.
scala> ^[[A // pressed up arrow
1 // pressed up arrow
res0: Int = 1
scala> ^D
[success] Total time: 7 s, completed Apr 20, 2018 10:21:52 AM
sbt:foo> [info] shutting down server
Possibly an issue with the sbt-extras
launcher? In any case I think maybe it's not a TLS issue, but rather something very strange that made it appear so. I'm fine closing this.
Looks like a race condition on some JVM global state mutation.
Workaround
initialCommands := "jline.TerminalFactory.get.init"
Not sbt-extras ... I don't use it.
Thanks for the workaround ... seeing as this appears to be down to SBT I'm going to close this.
With the following minimal build when if you run
console
more than once JLine stops working.Thus:
This doesn't happen with LBS.
I'm sorry. /cc @dwijnand