-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Please change color scheme #1200
Comments
Can you PR it? |
@octref how many people are still using 16-colour terminals though? |
@timoxley afaik most people. Although nowadays you can choose what those colors look like. |
@yoshuawuyts |
@timoxley In ANSI escape code 30-37 correspond to the colors(red, green, blue, etc) defined in your terminal. Mocha outputs a lot of message in color 90. https://github.com/visionmedia/mocha/pull/1212/files In my theme color 90 is too close to my background color that I can't see it. |
I don't really care about the framework. I just need to be able to run tests. I am going to switch to a different framework since the color scheme is basically unreadable, and I don't have time to figure out how to fix it. It looks pretty terrible in every terminal color scheme I have, but in my favorite scheme, the stack trace is invisible. |
+1 for pushing this :) |
In what terminal theme does a light green background color look good? I don't even know how mocha is supposed to look. |
So you do care about Thea
|
So you do care about the framework of you need to run tests with it.
|
I'm sorry. My message was confusing. I meant that I would be fine with a less powerful framework, so long as I can run tests that are visible. Mocha could be an awesome framework, but if my first experience with it is unreadable output, then I'm not going to care about how awesome it may be, I am going to switch to another framework. This was the first experience I had with mocha, and then I searched the internet for why I can't customize the output, and a bunch of people are saying that it isn't something mocha needs to fix. But if it isn't mocha's responsibility to look good in the terminal, why should I even care about the rest of the framework? A lot of good work went into mocha. It sucks that people like me are being turned away by an odd / and mostly unreadable color scheme (I could post how it looks in all of my terminals, all of them look really bad). And yes, I lied a bit. I do care about mocha. I want to use it. I like the async support (among other things). I'm just expressing the frustration of a newcomer who heard about how awesome it is, only to be turned away because I don't have a blessed terminal. |
@jeffmay
to
|
You can also do it at the top of your test, like this: var colors = require('mocha/lib/reporters/base').colors;
colors['diff added'] = 32;
colors['diff removed'] = 31; Again, not a wonderful solution, but the diffs are so much better. |
Based on @timshadel answer, I did something a little different. I explicitly set both the foreground and the background: var colors = require('mocha/lib/reporters/base').colors;
colors['diff added'] = '30;42';
colors['diff removed'] = '30;41'; I have a test-helper.js file that all of my tests include anyway so this is an easy fix. Setting the foreground like this should probably get rolled into mocha. Just my two cents. |
Any chance this has been addressed somewhere that works with release version. I have tried all the various tweaks outlined above, but nothing works. My issue is that I cant see any of the messages in terminal (running MobaXterm on Windows). |
@boneskull |
I'm just going to use chalk so nobody can complain Mocha uses weird ANSI escape sequences. |
if people have a problem with the colors thereafter, it's really, truly, not Mocha's fault |
(we're locked to v0.4.0 of chalk to keep node v0.8.0 support--its default npm version doesn't grok carets) |
While #2164 seems "more correct", and potentially a low-impact change, it won't help anybody running a "Solarized Dark" theme in iTerm. Running the official "Solarized Dark" theme in Terminal.app seems to work fine without any modifications. Let's recap:
I can now say with certainty, _if the colors Mocha uses aren't visible, your color theme is broken and/or your terminal is misconfigured_. If you are having problems wherein Mocha fails to display visible text, you will also have problems using other programs which leverage the same ANSI colors. If we changed the colors so theme A will display, there's no guarantee users of popular color theme B won't suffer invisible text as a result, because color theme B may be broken as well in a different manner. In either case, a terminal can be misconfigured. I still may be interested in merging #2164, but I am going to close this ticket. It's not really in Mocha's best interest to play whack-a-mole with invisible terminal colors. While tj may have been ultimately correct--and I had suspected as much--neither one of us did a great job of communicating about it (nor did we expend the effort to produce examples). If you are having this problem: Reconfigure your terminal and/or scheme to ensure all valid ANSI colors are clearly displayed. |
This comment was marked as abuse.
This comment was marked as abuse.
Do you have data to support this?
Mocha works fine for me in WebStorm terminal, using any color theme. I understand you are frustrated, but I would prefer to leave this issue unlocked so people can post workarounds or proper terminal configurations. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
I use Atom and WebStorm embedded terminals in addition to iTerm (all regularly), and have never had this problem. |
You can't tweak its color scheme, but you can adjust your terminal. 😄 |
It's a problem in the 'Darcula' theme, which almost everyone I observe using IntelliJ products seems to use now. |
This comment was marked as abuse.
This comment was marked as abuse.
Before: After: |
This comment was marked as abuse.
This comment was marked as abuse.
@jdmarshall thanks for the direction on that. |
also note above "ANSI: black" is actually white. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
There's is no need to make the background white, nor is that what my change in the screenshot did. I'm trying to understand the problem you're seeing. If that "exception" text is too dark, make it lighter by increasing the brightness on the "dark gray": If you're still having trouble, you may wish to consult the WebStorm documentation and/or contact someone at JetBrains. |
This comment was marked as abuse.
This comment was marked as abuse.
@dschinkel Put this file in your On a mac, this is But that's about the extent of what I can do to support JetBrains' products. Again, this is not a Mocha-specific issue. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
Just wanted to throw out there that I'm still bumping into this issue on gnome-terminal and xfce4-terminal, and I know this has a lot of talk, but as a new user of mocha, it's quite annoying :( It would be great if there was just a way to change, maybe via CLI, what color code gets used for secondary text output. |
@jeffvandyke Are you using Solarized Dark? Much as I love the theme, it's simply broken. It uses Bright Black as the background color. Simple as that. Take a look at the values section: http://ethanschoonover.com/solarized#the-values And the usage guide: http://ethanschoonover.com/solarized/img/solarized-values-dark.png If the background color was Black that might be forgivable, but I would never expect Bright Black to be the same as the background color. I've had this issue with other console applications and Solarized Dark as well. This isn't limited to Mocha at all. |
Gotcha, that does make sense. My workaround was to set Bright Black to one of the lighter gray colors in my terminal, but I see how solarized dark doesn't fit perfectly for 16-color terminals. Thanks! |
Many of the popular base16 themes are also affected by this. |
I've read through #802 and #590
I believe I've found where the issue lies:
Snippet from base.js
https://github.com/visionmedia/mocha/blob/master/lib/reporters/base.js
So the color function takes in a type and uses the conversion table above to get the ANSI escape color.
A chart can be found here:
http://en.wikipedia.org/wiki/ANSI_escape_code#CSI_codes
As you can see:
![screenshot from 2014-04-25 03 09 43](https://cloud.githubusercontent.com/assets/4033249/2793785/5ffc45e6-cbe4-11e3-88fc-7f6ab027e9a1.png)
Seems to be a closed-source terminal from IBM AIX.
I believe nobody is using mocha on it. (Correct me if I'm wrong)
Furthermore, I found the ECMA specification:
![mocha2](https://cloud.githubusercontent.com/assets/4033249/2793831/ef79afc4-cbe4-11e3-8f04-6b31c1c0cc0f.png)
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
Here is page 62:
Color 90-99 are not in the specification. Most terminals wouldn't care implementing these colors correctly and god knows what color they'll fall back into.
And not everyone uses iTerm2, which has a contrast setting.
Please use color 30-37, if you want increased intensity then
\u001b[30;1m
would use the intense variant.I think users are only responsible for configuring their terminals so the 16 colors look great on their bg/fg colors. So please don't just say "It's the theme's fault" and close the issue. It's mocha's problem not using color from the standard palette.
The text was updated successfully, but these errors were encountered: