scalameta / mdoc

Typechecked markdown documentation for Scala

Home Page:https://scalameta.org/mdoc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow watch mode with the sbt task to run in the background

steinybot opened this issue · comments

I once asked for watch to be removed from the sbt plugin however I have actually been trying to make use of it but without much luck.

In order to make it useful I am trying to run mdoc.SbtMain using bgRunTask so that it runs in the background but it still eats (most of) the input and stops whenever enter is pressed so it's not possible to run other sbt tasks or commands while it is running.

Something like:

  (Compile / bgRunMain).toTask(s" mdoc.SbtMain --watch")

I tried forking but I think that causes it to stop straight away, presumably because the input stream is closed.

I have reproduced it in this scripted test.

Would it be possible to not wait for enter but instead use the JobHandle that sbt uses for background tasks (e.g. bgStop 1)?