Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow JLine to fall back to a dumb terminal (#21330)
Set the `dumb` JLine option to `null` instead of `false` when a dumb terminal is not forced. This allows JLine to fall back to a dumb terminal if needed. Fixes #11978. Before: ``` ➜ ~/dotty git:(mb/11978) ✗ echo 'object Example { def smth = "smth" }' | bin/scala The `--offline` option is experimental Please bear in mind that non-ideal user experience should be expected. If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli Exception in thread "main" java.lang.IllegalStateException: Unable to create a terminal at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:394) at org.jline.terminal.TerminalBuilder.build(TerminalBuilder.java:362) at dotty.tools.repl.JLineTerminal.<init>(JLineTerminal.scala:34) at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:145) at dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:136) at dotty.tools.repl.Main$.main(Main.scala:7) at dotty.tools.repl.Main.main(Main.scala) Suppressed: java.io.IOException: Unable to find terminal provider ffm at org.jline.terminal.spi.TerminalProvider.load(TerminalProvider.java:74) at org.jline.terminal.TerminalBuilder.checkProvider(TerminalBuilder.java:667) at org.jline.terminal.TerminalBuilder.getProviders(TerminalBuilder.java:632) at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:395) ... 6 more Suppressed: java.io.IOException: Unable to find terminal provider jni at org.jline.terminal.spi.TerminalProvider.load(TerminalProvider.java:74) at org.jline.terminal.TerminalBuilder.checkProvider(TerminalBuilder.java:667) at org.jline.terminal.TerminalBuilder.getProviders(TerminalBuilder.java:634) at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:395) ... 6 more Suppressed: java.io.IOException: Unable to find terminal provider jansi at org.jline.terminal.spi.TerminalProvider.load(TerminalProvider.java:74) at org.jline.terminal.TerminalBuilder.checkProvider(TerminalBuilder.java:667) at org.jline.terminal.TerminalBuilder.getProviders(TerminalBuilder.java:636) at org.jline.terminal.TerminalBuilder.doBuild(TerminalBuilder.java:395) ... 6 more ``` After: ``` ➜ ~/dotty git:(mb/11978) echo 'object Example { def smth = "smth" }' | bin/scala The `--offline` option is experimental Please bear in mind that non-ideal user experience should be expected. If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli Aug 05, 2024 3:53:49 PM org.jline.utils.Log logr WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information) Welcome to Scala 3.6.0-RC1-bin-SNAPSHOT-git-dce4377 (17.0.8, Java OpenJDK 64-Bit Server VM). Type in expressions for evaluation. Or try :help. scala> // defined object Example scala> % ➜ ~/dotty ```
- Loading branch information