sbt-site
sbt-site copied to clipboard
previewAuto - "Press any key to stop." doesn't work
sbt 1.4.3, Linux. Process just hangs on forever, never pressing "any" key, nor ctrl-C, ctrl-D help. Only kill.
[info] Main Scala API documentation successful.
Embedded server listening at
http://127.0.0.1:4000
Press any key to stop.
pp
^C
[warn] Canceling execution...
^F^C
[warn] Canceling execution...
^C
[warn] Canceling execution...
^C
[warn] Canceling execution...
^C
[warn] Canceling execution...
^C
[warn] Canceling execution...
^C
[warn] Canceling execution...
Does this still happen with sbt-site 1.4.1? See https://github.com/sbt/sbt-site/pull/163
yes, I'm using 1.4.1
The issue is that unfiltered.util.RunnableServer does:
println("Press any key to stop.")
def doWait(): Unit = {
try { Thread.sleep(1000) } catch { case _: InterruptedException => () }
if(System.in.available() <= 0)
doWait()
}
doWait()
But input from sbt doesn't go on standard input.
~But input from sbt doesn't go on standard input.~
Actually it is that System.in.available always returns 0.
Fixed in sbt 1.7 (yet to be released) https://github.com/sbt/sbt/issues/6964