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.

NO_COLOR=1 does not suppress all color escapes

See original GitHub issue

Current behavior:

As mentioned here https://github.com/cypress-io/cypress/issues/1748#issuecomment-390682159 there is a NO_COLOR=1 flag. (It doesn’t seem documented though, I found it via Google. Maybe that’s another issue though.)

When this is set, most of the colors are suppressed, but I still see some things in the CI logs that seem like color escape codes.

2019-10-29T10:49:45.5683027Z     ✓ should allow brand creation (11492ms)
2019-10-29T10:49:51.2829146Z     ✓ should not allow creating the same brand (5803ms)
2019-10-29T10:49:51.3044692Z 
2019-10-29T10:49:51.3056465Z 
2019-10-29T10:49:51.3057924Z   2 passing (17s)`
Screen Shot 2019-10-29 at 2 58 49 PM

Desired behavior:

There should be no escape codes in the output, just ascii chars.

Steps to reproduce: (app code and test code)

  1. Set up a CI build on Azure Devops.
  2. Run Cypress with NO_COLOR=1 env var via Docker with the following command:
docker run --rm -t -e NO_COLOR=1 -v /work/agent-0/r1/a/src/cypress-files:/src cypress/included:3.4.1 -P /src

Versions

Cypress 3.4.1 running via Docker:

docker run --rm -t -e NO_COLOR=1 -v /work/agent-0/r1/a/src/cypress-files:/src cypress/included:3.4.1 -P /src

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
punkrockbuddyhollycommented, Feb 9, 2021

Not sure if this will help anyone but I’m running a Cypress docker image in a jenkinsfile and I found that I had to pass the NO_COLOR=1 env var to the docker run part rather than as an env flag passed to cypress run. Previously I was running cypress run --env NO_COLOR=1 and it was making no difference.

0reactions
pitgrapcommented, Apr 1, 2022

Another Information to this topic:

We have problems with our Cypress runs stdout in Jenkins. So we added “NO_COLOR=1”, but the problem didn’t disappear. I just retestet it locally on my machine and found colors in the summary.

tl;dr All outputs are free of color except the summary. See screenshot Screenshot 2022-04-01 133712 Is this a known issue? Shall I open a new issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NO_COLOR: disabling ANSI color output in various Unix ...
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 >
How can I check what level of color support a terminal has in ...
What I mean by this is create a function supportsColor() that checks how many colors can be displayed in sys.stdout , returning 0...
Read more >
macos - Is it possible to disable Terminal's automatic tweaking ...
Here's the trick that you need to know: Values set via RGB get mangled, those set via HSB do not. I had a...
Read more >
bash column command confused by ANSI color escapes
I've narrowed it down to the ANSI Color escape codes. If I remove those, the columns come out lined up. The zsh version...
Read more >
arXiv:2003.05291v1 [math.CO] 11 Mar 2020
Andrews's k-compositions [4] where every part but the last has k possible colors,. [12] where odd parts have two possible colors, ...
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