Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Sciss opened this issue Nov 22, 2020 · 6 comments
Closed

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

Sciss opened this issue Nov 22, 2020 · 6 comments

Comments

@Sciss
Copy link

Sciss commented Nov 22, 2020

No description provided.

@Sciss
Copy link
Author

Sciss commented Nov 22, 2020

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 Sciss changed the title previewAuto - "Press any key to stop." doesn previewAuto - "Press any key to stop." doesn't work Nov 22, 2020
@ennru
Copy link
Contributor

ennru commented Nov 23, 2020

Does this still happen with sbt-site 1.4.1?
See #163

@Sciss
Copy link
Author

Sciss commented Nov 23, 2020

yes, I'm using 1.4.1

@steinybot
Copy link
Contributor

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
Copy link
Contributor

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

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

@steinybot
Copy link
Contributor

Fixed in sbt 1.7 (yet to be released) sbt/sbt#6964

@ennru ennru closed this as completed Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants