Ammonite icon indicating copy to clipboard operation
Ammonite copied to clipboard

2.4.0 in Win10: Unable to create a system terminal, creating a dumb terminal

Open agateriver opened this issue 4 years ago • 6 comments

PS C:\Users\XX> amm Loading... Compiling C:\Users\XX.ammonite\predef.sc 7月 08, 2021 10:40:17 上午 org.jline.utils.Log logr 警告: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information) Welcome to the Ammonite Repl 2.4.0 (Scala 2.12.13 Java 11.0.2)

agateriver avatar Jul 08 '21 02:07 agateriver

This is almost certainly a JLine issue rather than an Ammonite issue per se. You might look in the JLine 3 issue tracker and see if there's anything relevant. (And you'll probably want to check to see what version of JLine 3 your Ammonite version uses.)

SethTisue avatar Jul 08 '21 03:07 SethTisue

I am having similar issues locally, I get an exception, the console doesnt work at all. :/
Considering replacing the JNA implementation with Jansi...

sake92 avatar Sep 02 '21 14:09 sake92

Maybe we should do the same as Mill in https://github.com/com-lihaoyi/mill/pull/1308.

Are you having the same issue with a coursier-installed Ammonite, or with cs launch ammonite? I don't have this issue on my Windows machine, possibly because coursier already sets up the terminal slightly differently, via windows-ansi or coursier-jni-utils.

alexarchambault avatar Sep 02 '21 14:09 alexarchambault

@alexarchambault My issue is unrelated to escape sequences.
It gets in an infinite loop:

java.lang.IllegalStateException org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:538) org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:454) ammonite.repl.FrontEnds$JLineTerm.readCode$1(FrontEnds.scala:57) ammonite.repl.FrontEnds$JLineTerm.$anonfun$action$3(FrontEnds.scala:78) ammonite.util.Catching.flatMap(Res.scala:115) ammonite.repl.FrontEnds$JLineTerm.action(FrontEnds.scala:66) ammonite.repl.Repl.$anonfun$action$4(Repl.scala:194) ammonite.repl.Scoped.$anonfun$flatMap$1(Signaller.scala:45) ammonite.repl.Signaller.apply(Signaller.scala:28) ammonite.repl.Scoped.flatMap(Signaller.scala:45) ammonite.repl.Scoped.flatMap$(Signaller.scala:45) ammonite.repl.Signaller.flatMap(Signaller.scala:16) ammonite.repl.Repl.$anonfun$action$2(Repl.scala:178) ammonite.util.Catching.flatMap(Res.scala:115) ammonite.repl.Repl.action(Repl.scala:170) ammonite.repl.Repl.loop$1(Repl.scala:212) ammonite.repl.Repl.run(Repl.scala:227) ammonite.Main.$anonfun$run$1(Main.scala:232) scala.Option.getOrElse(Option.scala:201)

I tried both powershell and cmd, same behavior.. :/

sake92 avatar Sep 02 '21 21:09 sake92

Could it be that it is being called from multiple threads?
https://javadoc.io/doc/org.jline/jline/3.12.1/org/jline/reader/LineReader.html

Any attempt to call one of the readLine call while one is already executing in a different thread will immediately result in an IllegalStateException being thrown.

sake92 avatar Sep 02 '21 21:09 sake92

It is really odd that it's working fine in Cmder and GitBash, but not in native shells: CMD/PowerShell ... :/

sake92 avatar Sep 20 '21 13:09 sake92