Skip to content

REPL doesn't work on Windows: Consider directly using JLine 3 for the REPL #4309

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

Closed
smarter opened this issue Apr 13, 2018 · 10 comments
Closed

Comments

@smarter
Copy link
Member

smarter commented Apr 13, 2018

The REPL UI code in Dotty comes from ammonite-terminal and lives in https://github.com/lampepfl/dotty/tree/master/compiler/src/dotty/tools/repl/terminal, it works well enough but does not support Windows. This has been recently fixed in Ammonite by using JLine 3 under Windows. We could merge these changes in our version of ammonite-terminal, but if we're going to depend on JLine anyway we could also drop our version of ammonite-terminal and just use JLine directly (unless there's some features of ammonite-terminal we really need).

@allanrenucci
Copy link
Contributor

Here is the Ammonite PR for reference: com-lihaoyi/Ammonite#775

@allanrenucci allanrenucci self-assigned this May 4, 2018
@Glavo
Copy link
Contributor

Glavo commented May 18, 2018

I'm looking forward to using jline3 to implement dotty repl, because jline3's complement feature is very cool

@djx314
Copy link

djx314 commented May 18, 2018

+1 to use jline3 to support colourful output and mutiply lines coding in windows.

@Blaisorblade Blaisorblade changed the title Consider directly using JLine 3 for the REPL REPL doesn't work on Windows: Consider directly using JLine 3 for the REPL May 26, 2018
@Blaisorblade
Copy link
Contributor

@Glavo
Copy link
Contributor

Glavo commented May 26, 2018

Now, there is still a problem with our Dotty REPL support for Chinese characters:
https://1drv.ms/v/s!Aj9QXHXa1Zz7jC_xz45zLZvrDPTw

Jline 3 can help us solve this problem:
https://1drv.ms/v/s!Aj9QXHXa1Zz7jDAjVfceTfqzMrZE

@Blaisorblade
Copy link
Contributor

@Glavo Ah, so those are two characters but our REPL shows the cursor one character before it should be, as if they were one?

@Glavo
Copy link
Contributor

Glavo commented May 27, 2018

@Blaisorblade Yes, and Ammonite also has this problem when not using the jline 3 front end.

@tisonkun
Copy link

As for the issue of Chinese characters, note that JLine's output transfer “你好” to its codepoint

@Blaisorblade
Copy link
Contributor

As for the issue of Chinese characters, note that JLine's output transfer “你好” to its codepoint

@W4anD0eR96 Yes but I think that's a separate difference, independent from JLine and due to Ammonite's and Dotty's approaches at printing values — Dotty prints strings with toString (so "hi" prints hi, hence just print the actual content). Ammonite instead prints strings using PPrint, hence "hi" prints as "hi" and Unicode characters can be quoted.

@allanrenucci
Copy link
Contributor

Fixed in #4680

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

No branches or pull requests

6 participants