Closed bbarker closed 4 weeks ago
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.
Going to call this fixed since we've overhauled the Mill client-server setup a few times since then
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 executingreadLine
.