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

allow Windows REPL default -Dscala.color=auto to show colors #10979

Open
wants to merge 1 commit into
base: 2.13.x
Choose a base branch
from

Conversation

philwalk
Copy link
Contributor

@philwalk philwalk commented Jan 9, 2025

This implements the change proposed in bug/issues/13077.
It addresses this scala-cli bug : scala-cli/issues/#3394

The change was manually verified by confirming color is enabled by default:

  • Command Prompt session in Windows Terminal
    image

  • CMD.EXE session
    image

  • MSYS64 bash shell
    image

  • CYGWIN session running in Windows Terminal
    image

  • CYGWIN session in MINTTY console
    image

  • Git Bash session in Windows Terminal
    image

  • MINGW64 in Windows Terminal
    image

  • WSL2 Ubuntu Linux session
    image

Verified that color can be disabled on the command line:
image

@scala-jenkins scala-jenkins added this to the 2.13.17 milestone Jan 9, 2025
@SethTisue SethTisue added prio:hi high priority (used only by core team, only near release time) tool:REPL Changes in the Scala REPL Interpreter labels Jan 9, 2025
@SethTisue
Copy link
Member

wow, really nice testing, you for that!!

@@ -141,7 +141,7 @@ private[scala] trait PropertiesTrait {
/* Some runtime values. */
private[scala] lazy val isAvian = javaVmName.contains("Avian")

private[scala] def coloredOutputEnabled: Boolean = propOrElse("scala.color", "auto") match {
private[scala] def coloredOutputEnabled: Boolean = propOrElse("scala.color", "true") match {
case "auto" => !isWin && consoleIsTerminal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different change than I would have expected. I would think we'd want to leave auto as the default, but remove the !isWin && from line 145?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently, tests are not colorized, for example. That's a lot of tests broken by so few chars.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio:hi high priority (used only by core team, only near release time) tool:REPL Changes in the Scala REPL Interpreter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants