mill
mill copied to clipboard
Apparent blocking occurs when reading standard input when using `mill -i`
As discussed on gitter mill -i should allow for standard input to be read in from code being executed by mill. However, when I tried this with this minimal project, it seems to hang/block when executing readLine.
In a bizarre turn of events, if you launch the scala console via mill, you can get early termination (type any key and readPassword will immediately return, followed by corrupted output to the console (multiple characters appearing for each key typed, etc):
$ mill -i sbh.core.console
Compiling (synthetic)/ammonite/predef/interpBridge.sc
Compiling /home/brandon/workspace/sbh/build.sc
[53/53] sbh.core.console
Welcome to Scala 2.12.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_172).
Type in expressions for evaluation. Or try :help.
scala> import edu.cornell.cac.sbh.Util._
import edu.cornell.cac.sbh.Util._
scala> readPassword(None)
res0: Array[Char] = Array(A)
scala> SSDDFF^^^^?^?^?^?^?^?^?^?^M
scala> ^M
scala> aassddffllkkjj^M
<console>:16: error: not found: value asdflkj
asdflkj
^
scala> ::qquuiitt^M
However, Util.readLine seems to work here.
Is this also related to my problem? https://stackoverflow.com/questions/57082367/why-does-running-the-zio-app-with-mill-not-work
Is this also related to my problem? https://stackoverflow.com/questions/57082367/why-does-running-the-zio-app-with-mill-not-work
No.