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

REPL: -Djline.WindowsTerminal.directConsole=false does not work on Windows #7061

Closed
scabug opened this issue Feb 4, 2013 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Feb 4, 2013

When starting REPL having set

C:>set JAVA_OPTS=-Djline.WindowsTerminal.directConsole=false

jline still uses direct console mode.

My fix was to make a small change to scala.tools.jline.WindowsTerminal such that the absence of \ -Djline.WindowsTerminal.directConsole is the equivalent of \ -Djline.WindowsTerminal.directConsole=true rather than it being \ -Djline.WindowsTerminal.directConsole=false \ and then to honor the setting less conditionally in the code.

Interestingly the version of jline in sbt does not seem to have this problem.

See lines marked "******** NS ********" in attached source file

@scabug
Copy link
Author

scabug commented Feb 4, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7061?orig=1
Reporter: Nik Shaylor (nshaylor)
Affected Versions: 2.10.0
Attachments:

@scabug
Copy link
Author

scabug commented Jun 25, 2013

@adriaanm said:
We're planning to move to vanilla jline2 in 2.11-M4. Hopefully that fixes it.

@scabug
Copy link
Author

scabug commented Jul 10, 2013

@adriaanm said:
Unassigning as milestone deadline was reached.

@scabug
Copy link
Author

scabug commented Sep 1, 2013

Tony Sloane (asloane) said:
Just noting that this bug is a blocker for my SublimeText ScalaWorksheet plugin (https://bitbucket.org/inkytonik/scalaworksheet).

My plugin does not currently work on Windows because the Scala REPL doesn't see any input that is redirected in from a file (https://bitbucket.org/inkytonik/scalaworksheet/issue/5/scalaworksheet-doesnt-work-on-windows).

Setting the jline.WindowsTerminal.directConsole to false enables JLine to see redirected stdin on Windows (for the example JLine program). But due to the issue reported here, that fix doesn't work for the Scala REPL.

I think it's likely that moving to vanilla JLine 2 will fix the problem for Scala 2.11.

It would be great to also see a fix back-ported to Scala 2.10, since a lack of one means that my plugin will never work with anything earlier than 2.11 on Windows.

@scabug
Copy link
Author

scabug commented Oct 20, 2013

@retronym said:
This is fixed in 2.11:

https://dl.dropboxusercontent.com/u/106552/screenshots/Screen%20Shot%202013-10-20%20at%207.09.16%20PM.png

We're focussed on 2.11 at the moment. We might accept a pull request to backport the Jline fix to 2.10 if if is clearly low risk (this seems to fall into that category, unlike most JLine changes.)

@scabug scabug closed this as completed Oct 20, 2013
@scabug
Copy link
Author

scabug commented Oct 20, 2013

Tony Sloane (asloane) said:
Thanks for the move to "real JLine". I'll look at a backport to 2.10 if I can find some time...

@scabug
Copy link
Author

scabug commented Oct 20, 2013

Tony Sloane (asloane) said:
Forgot to explicitly mention that my Scala Worksheet plugin is fine now on Windows with 2.11 (tested with 2.11.0-M5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants