codecrafters-io/cli

Respect NO_COLOR variable and/or dumb variable type

pedramos opened this issue · 1 comments

Reference: https://no-color.org/

Would it be possible for the tool (and the output from remote when doing a git push) to respect no-color env variable and/or stop printing colors when the terminal type is dumb?

If I'm not wrong, the Git server handling the git push doesn't have environment variable context, so we can't detect this.

The CLI tool can detect NO_COLOR though, and we could filter out ANSI codes from output. Open to PRs!

For anyone looking for a workaround in the meantime, you can install strip-ansi-cli do codecrafters test | strip-ansi.