-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Color REPL under -Dscala.color #3993
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
Conversation
We already use -Dscala.color when using -Ytyper-debug This tries to reuse the colors chosen from the debug flag: * Bold blue for vals (e.g. "res0") * Bold green for types (e.g. "Int") * Magenta for the shell prompt (e.g. "scala>")
Looks like a flakey test in the scala-refactoring suite.
PLS REBUILD ALL |
This change fulfils part I of https://issues.scala-lang.org/browse/SI-4223. |
(kitty-note-to-self: ignore 56330649) |
It is probably worthwhile to discuss what we would need to do to turn this on by default in the REPL. To avoid the effecting tools that programatically drive the REPL, we could predicate it based on a suitable terminal environment: scala> new jline.console.ConsoleReader().getTerminal.isAnsiSupported
res3: Boolean = true We could also have a system property to turn it off explicitly. Maybe we'd target this change at 2.12 both to be conservative and to give the feature (and the colour pallette) some time to mature. |
* Errors are red * Warnings are yellow
@retronym I did, thank you. |
Cool, more flair for the REPL! What's the status of the missed spot? |
Given missing activity, rescheduling for 2.11.4 (to happen at the end of November). |
I'm happy to work on this tonight, if that's not too late to get into this release. |
Hi @puffnfresh! |
@gkossakowski sounds great 👍 |
@gkossakowski good to go: |
How does it look on a light black-on-white themed terminal? |
@retronym as far as I know, most terminals choose colours which work on black or white. You be the judge, though: |
That looks good enough for now. If we turn it on by default in 2.12, we can polish that a little further. Thanks! |
Yeah, I'm hoping for a tiny amount of data before the bike shedding starts. |
Color REPL under -Dscala.color
Yay, nice idea. 👍 |
FTR: here's how to enable it automatically in sbt: Put this into your initialize ~= { _ =>
val ansi = System.getProperty("sbt.log.noformat", "false") != "true"
if (ansi) System.setProperty("scala.color", "true")
} |
I would suggest to predicate this on
|
Was this announced anywhere? This is probably the biggest improvement to the Scala REPL since the great war of 1939 |
;-) i believe it was included in forSome release notes, but happy to tout it again (handwritten.md over at scala/make-release-notes) |
thank u~ |
We already use -Dscala.color when using -Ytyper-debug
This tries to reuse the colors chosen from the debug flag: