Skip to content

Commit e332497

Browse files
committed
JLineTerminal: allow to change prompt via inheritance
1 parent 89dd249 commit e332497

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/src/dotty/tools/repl/JLineTerminal.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import org.jline.reader.impl.history.DefaultHistory
1616
import org.jline.terminal.TerminalBuilder
1717
import org.jline.utils.AttributedString
1818

19-
final class JLineTerminal extends java.io.Closeable {
19+
class JLineTerminal extends java.io.Closeable {
2020
// import java.util.logging.{Logger, Level}
2121
// Logger.getLogger("org.jline").setLevel(Level.FINEST)
2222

@@ -30,7 +30,8 @@ final class JLineTerminal extends java.io.Closeable {
3030
private def blue(str: String)(using Context) =
3131
if (ctx.settings.color.value != "never") Console.BLUE + str + Console.RESET
3232
else str
33-
private def prompt(using Context) = blue("\nscala> ")
33+
protected def promptStr = "scala"
34+
private def prompt(using Context) = blue(s"\n$promptStr> ")
3435
private def newLinePrompt(using Context) = blue(" | ")
3536

3637
/** Blockingly read line from `System.in`

0 commit comments

Comments
 (0)