sbt-site icon indicating copy to clipboard operation
sbt-site copied to clipboard

previewAuto - "Press any key to stop." doesn't work

Open Sciss opened this issue 4 years ago • 6 comments

Sciss avatar Nov 22 '20 22:11 Sciss

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...

Sciss avatar Nov 22 '20 22:11 Sciss

Does this still happen with sbt-site 1.4.1? See https://github.com/sbt/sbt-site/pull/163

ennru avatar Nov 23 '20 09:11 ennru

yes, I'm using 1.4.1

Sciss avatar Nov 23 '20 12:11 Sciss

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.

steinybot avatar Jul 10 '22 01:07 steinybot

~But input from sbt doesn't go on standard input.~

Actually it is that System.in.available always returns 0.

steinybot avatar Jul 10 '22 05:07 steinybot

Fixed in sbt 1.7 (yet to be released) https://github.com/sbt/sbt/issues/6964

steinybot avatar Jul 10 '22 20:07 steinybot