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

Add support for opting out of ANSI coloring via command-line switch & cake.config #3138

Open
augustoproiete opened this issue Feb 13, 2021 · 3 comments · May be fixed by #2999
Open

Add support for opting out of ANSI coloring via command-line switch & cake.config #3138

augustoproiete opened this issue Feb 13, 2021 · 3 comments · May be fixed by #2999
Assignees

Comments

@augustoproiete
Copy link
Member

In #2975 we introduced a way to opt-out of ANSI coloring by setting an environment variable (NO_COLOR).

This issue is about introducing two more alternative ways to opt-out of ANSI coloring:

  1. Via a new command-line switch e.g. --no-color and/or --settings_color=never

  2. Via a configuration setting in cake.config


For the configuration options, I suggest adding a new configuration value under Settings called Color, which can be one of the following values:

  • auto - Let AnsiDetector decide if color is supported or not based on environment (default)
  • never - opt out of coloring, regardless of environment (skip the logic to detect if color is supported or not)
  • always - opt in on coloring, regardless of environment (skip the logic to detect if color is supported or not)

The color option would be available as ...

  • An argument passed into Cake: --settings_color <value>
  • A configuration file value: Color=value (under the Settings section)
  • An environment variable: CAKE_SETTINGS_COLOR=value

... and follow the same priority order as other configuration values.

@LukasBil
Copy link

Hi @augustoproiete, I would like to take this one on me.

@augustoproiete
Copy link
Member Author

Hey @LukasBil this one turned out to be more complex than I thought it would be because the cake.config file is read at a later stage, after the Console has already been created, and the decision to support color (or not) has already been made by then.

I started working on this on GH-2975: Add Settings_Color configuration option #2999 and I'm currently waiting for comments.

Do you want to take a look at the details in the PR and decide if you want to take this forward?

If not, there are other easier ones you might be interested in tackling.

@LukasBil
Copy link

Thanks @augustoproiete. As I'm still quite new on the codebase, I'll pick one of existing g-f-i's.

@augustoproiete augustoproiete self-assigned this Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants