-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
jline3 console detection is fragile in Windows cmd.exe, cygwin, msys, and mingw environments. #12405
Comments
Could you report this against jline directly? https://github.com/jline/jline3/issues, it would be nicer if this could be fixed upstream so we don't have to add our own workarounds. |
I am reporting this to jline, although I think there might also be problems in how scala initializes it, or in how we setup our I any event, I'd like to submit a PR for a workaround to allow a functioning The jline error report: jline/jline3#669 |
…27.1 (was 3.27.0) (#22205) as per the https://github.com/jline/jline3 readme and as per discussion and linked items on #22201 fixes #22201 note that as far as I can tell, the stuff I removed from libexec/common-shared is dead code @philwalk dunno if you're still around but judging from #12405 you might be a good reviewer here note that I believe we _don't_ need to also port scala/scala#10889 here, since we are already using separate JLine JARs rather than the all-in-one JAR I've chosen not to upgrade all the way to JLine 3.28.0 at the moment, as it is quite new (2 days ago) and doesn't appear to have any fixes that might be critical.
Compiler version
sbt:scala3> print scalaVersion
scala3-sbt-bridge / scalaVersion
3.0.0-RC3
scala3-library / scalaVersion
3.0.0-RC3
scala3-compiler / scalaVersion
3.0.0-RC3
scala3-interfaces / scalaVersion
3.0.0-RC3
tasty-core / scalaVersion
3.0.0-RC3
scalaVersion
3.0.0-RC3
sbt:scala3>
Minimized code
Output
The output depends on environment variables, but in Windows, the jline3 code for identifying the current console environment is fragile. When launching the scala REPL, if jline3 misidentifies the environment, the result is not good, so it might make sense to take defensive measures to protect the REPL experience from random accidents.
Some examples:
with console
CMD.EXE
, and PWD=, jline3 mis-identifies Cygwin.A
REPL
session whenPWD
is defined and starts with a slash:The session looks bad, and the arrow keys are not functional.
A workaround is to unset
PWD
immediately prior to starting the jvm.FYI, here is my
scala3.bat
file:I stumbled onto this problem accidentally, and PWD would not typically be set in a
CMD.EXE
session.A bigger issue is that I have the same bad
REPL
experience in aCYGWIN
bash session with consolemintty
. I have to fake a non-cygwin environment to have a good and functionalREPL
experience. Perhaps something is unusual about my system, and I do have somewhat similar problems withsbt
as well (I have to fake a non-cygwin environment).I'm testing other environments, see detailed summary below.
Expectation
Scala
REPL
sessions should not be sensitive to fragile console detection. I'll post updates as I learn more about the problem.The text was updated successfully, but these errors were encountered: