Dotty: Error while handling unicode characters in REPL

Created on 20 Jan 2019  路  8Comments  路  Source: lampepfl/dotty

Writing

scala> class 馃槂

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.

repl bug

All 8 comments

is this a JLine bug ?

Cannot be reproduced.

Copy paste class 馃槂 into the REPL and then delete 3 characters. It still happens.

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 in the sbt scala console under Intellij IDE, unable to reproduce the problem.

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.
Running the Scala 2.13.3 REPL in mintty/bash, there is an issue where all but the initial character can be deleted, but the initial 'c' remains.

Interestingly, if I enter the REPL from SBT, the problems go away, it only occurs when running the dotr script from the console.

Does it work when using the new Windows Terminal (https://github.com/microsoft/terminal) ?

Here's my experiment, performed on Windows 10 x64

  1. cd to a dotty project
  2. sbt console (sbt 1.3.13)
  3. paste "class 馃槂"
  4. hit "backspace" 3 times

Here's what remains:

scala> cclas

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"sbt.bat"windows script.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

odersky picture odersky  路  27Comments

odersky picture odersky  路  94Comments

odersky picture odersky  路  28Comments

megri picture megri  路  29Comments

felixmulder picture felixmulder  路  120Comments