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

JLine 3: :paste is misbehaving (continuation prompt should be suppressed) #703

Closed
SethTisue opened this issue Mar 26, 2020 · 2 comments · Fixed by scala/scala#8848
Closed
Assignees
Labels
blocker t:repl JLine 3 upgrade (scala/scala#8036)
Milestone

Comments

@SethTisue
Copy link
Member

reported by @bishabosha at scala/scala#8036 (comment)

@SethTisue SethTisue added blocker t:repl JLine 3 upgrade (scala/scala#8036) labels Mar 26, 2020
@SethTisue SethTisue changed the title JLine 3: :paste is misbehaving; old-style continuation handling interferes JLine 3: :paste is misbehaving (continuation prompt should be suppressed) Mar 30, 2020
@SethTisue
Copy link
Member Author

SethTisue commented Mar 31, 2020

I had initially thought the old continuation-handling code must be interfering, but no, it's simpler than that.

in Reader.scala, we do:

        .variable(SECONDARY_PROMPT_PATTERN, config.encolor(config.continueText))

and this then applies to regular mode (good) but also to paste mode (bad). so that's the cause

to fix it, in ILoop#pasteCommand we need to setVariable(LineReader.SECONDARY_PROMPT_PATTERN, "") and then restore it when we're done. but ILoop doesn't have direct access to its org.jline.reader.LineReader, so I think we need to add a method to nsc.interpreter.jline.Reader that handles this (it can be a no-op when we're running without JLine involved, as during testing)

I verified that this does the trick if done unsafely using in.asInstanceOf[jline.Reader], now I just need to do that the right way

@SethTisue SethTisue self-assigned this Mar 31, 2020
@SethTisue SethTisue added this to the 2.13.2 milestone Mar 31, 2020
SethTisue added a commit to SethTisue/scala that referenced this issue Mar 31, 2020
SethTisue added a commit to SethTisue/scala that referenced this issue Mar 31, 2020
@SethTisue
Copy link
Member Author

closing on the presumption my fix will be merged

SethTisue added a commit to SethTisue/scala that referenced this issue Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker t:repl JLine 3 upgrade (scala/scala#8036)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant