question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for opting out of ANSI coloring via NO_COLOR env. variable

See original GitHub issue

Cake is able to detect if ANSI coloring is supported in a number of cases, but once it detects that color is supported, there’s no way of opting out of it at the moment.

Some ideas:

  • Check for the existence of an environment variable (NO_COLOR seems to be a standard) to opt out of ANSI coloring
  • Add a new command-line switch e.g. --no-color and/or --color=false to opt out of ANSI coloring

Common options used to determine if ANSI coloring should be disabled used by some apps on GitHub:

  • Command-line arguments:

    • --no-color
    • --no-colors
    • --color=false
    • --color=never
  • Environment variables:

    • TERM=dumb
    • FORCE_COLOR=false
    • FORCE_COLOR=0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
patriksvenssoncommented, Dec 7, 2020

@pascalberger Makes sense to respect NO_COLOR since that’s a pretty common convention. Other than that, the rest could be done in Cake.

1reaction
pascalbergercommented, Dec 7, 2020

Configuration should IMHO be possible as other configuration options through environment variable, configuration file and argument.

@patriksvensson Is this something which should be done in Spectre.CLI?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NO_COLOR: disabling ANSI color output by default
Software Description Date / Version Supported alogview Android logcat Filter 2018‑10‑31 Ammonite Scala Scripting 2017‑07‑03 / 1.0.0 Ansible IT automation system 2021‑04‑26 / 2.11.0
Read more >
No_color
NO_COLOR is a hint to the software running in the terminal to suppress addition of color, not to the terminal to prevent any...
Read more >
Removing colors from output - bash
I have some script that produces output with colors and I need to remove the ANSI codes. #!/bin/bash exec > >(tee log) #...
Read more >
a proposal to disable ANSI colors in a uniform way
NO_COLOR is a hint to the software running in the terminal to suppress addition of color, not to the terminal to prevent any...
Read more >
How to get coloured terminal over ssh? - command line
I am thinking I could have just added "|xterm" after "color" in the first line, or dug around and figure out why ssh...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found