-
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
Error while handling unicode characters in REPL #5755
Comments
is this a JLine bug ? |
Cannot be reproduced. |
Copy paste |
I'm able to reproduce this FWIW |
Can you reproduce this using the Scala 2.13.3 repl too? If so, it's a JLine bug and should be filed at https://github.com/jline/jline3/ |
Running on WSL ubuntu, I can't reproduce the problem in either the dotty REPL or the scala 2.13.3 REPL. Running on the Windows jdk, there are problems in both dotty and scala 2.13.3, although they differ. Below is a discription of what I think I'm getting, but I need to thoroughly verify the specifics of my Windows environment, since I'm having other problems with sbt. Running dotty REPL in mintty/bash on Windows 10. the problem occurs exactly as described by @nicolasstucki. Interestingly, if I enter the REPL from SBT, the problems go away, it only occurs when running the |
Does it work when using the new Windows Terminal (https://github.com/microsoft/terminal) ? |
Here's my experiment, performed on Windows 10 x64
Here's what remains:
In case it matters, the only way I have been able to create a usable sbt environment (even when running cygwin bash) is to run the |
Unable to reproduce this problem using sbt 1.4.7 in any of several Windows shell environments"
and across 4 terminals:
Perhaps this was fixed as a side-effect of recent changes. |
Now if I paste scala> class Does not misalign anymore but it is a different regression with usicode characters. Same happens if we paste the usicode character scala> ""
val res0: String = |
The weird/incorrect backspacing before reproduces for me on 3.3.1 and 3.4.1-RC1-bin-20240212-c529a48-NIGHTLY on MacOS. (I don't get the thing Nico mentions with the box — I see the smiley face.) The problem doesn't happen in Scala 2.13.12 or 2.13.13. So it's possible it's a JLine bug and perhaps it would go away if Dotty were to upgrade to a newer JLine version — that's the first thing to try. 2.13.13 is on JLine 3.24.1, whereas here in this repo you're still on 3.19. |
If we add a new line between the class and the emojis and backspace, it does work correctly. scala> class
| 😃 |
Fixes #5755, #19704 Tested locally and the difference in behaviour was observed. I'm not sure how to test it with the CI, if anybody has an idea, please let me know. Also, this issue might be a problem sbt/sbt#7177 Tested as follow: - Observe that the issue in `3.4.1-RC1` ```scala scala-cli repl -S 3.4.1-RC1 Welcome to Scala 3.4.1-RC1 (17.0.7, Java Java HotSpot(TM) 64-Bit Server VM). Type in expressions for evaluation. Or try :help. scala> class 😃 // defined class 😃 scala> cclas -- [E006] Not Found Error: ----------------------------------------------------- 1 |clas |^^^^ |Not found: clas - did you mean caps? | | longer explanation available when compiling with `-explain` 1 error found scala> ``` - Publish dotty locally with the correct jline version - Observe that the issue is fixed ```scala scala-cli repl -S 3.4.2-RC1-bin-SNAPSHOT Welcome to Scala 3.4.2-RC1-bin-SNAPSHOT-git-174d4c6 (17.0.7, Java Java HotSpot(TM) 64-Bit Server VM). Type in expressions for evaluation. Or try :help. scala> class 😃 // defined class 😃 scala> clas -- [E006] Not Found Error: ----------------------------------------------------- 1 |clas |^^^^ |Not found: clas - did you mean caps? | | longer explanation available when compiling with `-explain` 1 error found scala> ``
Writing
and then backspace 3 times confuses the repl
scala> cclas
There is probably a wrong computation of the current cursor in presence of unicode characters.
The text was updated successfully, but these errors were encountered: