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

Running console without -i results in opaque error #2858

Closed
mrdziuban opened this issue Nov 3, 2023 · 1 comment
Closed

Running console without -i results in opaque error #2858

mrdziuban opened this issue Nov 3, 2023 · 1 comment
Milestone

Comments

@mrdziuban
Copy link
Contributor

I see that there is code that's meant to catch when users run console without the -i/--interactive flag but it doesn't seem to be working. Instead of seeing the error message there, I see:

Exception in thread "main" java.lang.IllegalStateException: Unable to create a system terminal
	at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:323)
	at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:265)
	at dotty.tools.repl.JLineTerminal.<init>(JLineTerminal.scala:25)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:143)
	at dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:134)
	at dotty.tools.repl.Main$.main(Main.scala:7)
	at dotty.tools.repl.Main.main(Main.scala)
1 targets failed
test.console java.lang.Exception: Interactive Subprocess Failed (exit code 1)
    mill.util.Jvm$.runSubprocess(Jvm.scala:184)
    mill.util.Jvm$.runSubprocessWithBackgroundOutputs(Jvm.scala:152)
    mill.util.Jvm$.runSubprocess(Jvm.scala:88)
    mill.scalalib.ScalaModule.$anonfun$console$2(ScalaModule.scala:369)
    scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
    scala.Console$.withErr(Console.scala:193)
    mill.api.SystemStreams$.$anonfun$withStreams$2(SystemStreams.scala:62)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
    scala.Console$.withOut(Console.scala:164)
    mill.api.SystemStreams$.$anonfun$withStreams$1(SystemStreams.scala:61)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
    scala.Console$.withIn(Console.scala:227)
    mill.api.SystemStreams$.withStreams(SystemStreams.scala:60)
    mill.scalalib.ScalaModule.$anonfun$console$1(ScalaModule.scala:374)
    mill.define.Task$TraverseCtx.evaluate(Task.scala:71)

Here's a repository that reproduces it: https://github.com/mrdziuban/mill-console-test

@lihaoyi
Copy link
Member

lihaoyi commented Aug 13, 2024

Should be fixed by #3346 I think

@lihaoyi lihaoyi closed this as completed Aug 13, 2024
@lefou lefou added this to the 0.12.0 milestone Aug 14, 2024
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