kiama icon indicating copy to clipboard operation
kiama copied to clipboard

Fix arrow behaviour in REPLs when using sbt 1.4.x

Open inkytonik opened this issue 4 years ago • 6 comments

Since 2.4.0 it seems that back arrow moves the cursor backwards but erases the skipped-over character on the screen (but not in the input). This makes line editing basically impossible because you can't see what you are doing.

Reproduce with

extras/Test/runMain org.bitbucket.inkytonik.kiama.example.lambda.Lambda

then enter some text, back arrow over some of it. You will see spaces where the skipped-over characters should be.

inkytonik avatar Jan 12 '21 23:01 inkytonik

Presumably related to JLIne. Move to JLine 3 while we're at it?

inkytonik avatar Jan 12 '21 23:01 inkytonik

It seems that JLine3 causes more problems than it's worth. Also, sbt seems to still be on JLine2 for most Scala versions, so it's easier if we stay there too.

inkytonik avatar Jan 13 '21 00:01 inkytonik

Ok, new information. If we run the Lambda program mentioned above outside sbt (i.e., by extracting the CLASSPATH and running java with that CLASSPATH directly), everything is fine. This suggests that the problem is due to interaction between sbt's use of JLine and Kiama's.

In Kiama 2.4.0 we are still using JLine2, but sbt as of 1.4.0 moved to JLine3. The approach that Kiama previously used to interoperate nicely with sbt is no longer working properly.

Ideally, we should move to JLine3 to get the latest and greatest, but also work out a way to make it interoperate with sbt again.

inkytonik avatar Jan 17 '21 08:01 inkytonik

It seems that everything is ok on Linux (or at least one version of Linux). So maybe this is a Mac-specific thing.

inkytonik avatar Jan 18 '21 04:01 inkytonik

A workaround is to stay with sbt 1.3.x which works fine with Kiama 1.4.0.

inkytonik avatar Jan 18 '21 05:01 inkytonik

Using a backspace character (control-H) works fine.

inkytonik avatar Jul 05 '21 00:07 inkytonik