Skip to content

Remove vertical bars in multi-line editing in REPL to make copy-paste easier #17651

@bjornregnell

Description

@bjornregnell

The Scala REPL starts emitting vertical bars when entering multi-line editing (e.g. with incomplete code or Alt+Enter):

Welcome to Scala 3.2.1 (17.0.5, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> (
     | 
     | 
     | 
     | 42)

This makes copy-paste from REPL to an editor/IDE/Scastie/REPL very tedious as all the bars needs to be removed. We often paste in forums etc and people cannot easily try things out by a simple copy paste from the post.

An indented line with no scala> prompt is could be enough as an indication of multi-line editing.

Edit: An idea by @smarter from comments below: use another background color as visual cue for multi-line editing mode, which does not affect copy-paste.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions