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

Much of the color output is invisible with solarized terminal theme #802

Closed
necolas opened this issue Apr 10, 2013 · 27 comments · Fixed by #1648
Closed

Much of the color output is invisible with solarized terminal theme #802

necolas opened this issue Apr 10, 2013 · 27 comments · Fixed by #1648

Comments

@necolas
Copy link

necolas commented Apr 10, 2013

If you use the Solarized Dark terminal theme (very popular), then you can't see the majority of the terminal output for success or error. Bower had a similar problem with a certain shade of grey effectively being invisible.

@kevva
Copy link

kevva commented Apr 10, 2013

It's the color code 90 to be specific, used in color names like pass, fast, light etc.

@ghost
Copy link

ghost commented Apr 29, 2013

Yeah I’ve noticed the same, also with other themes (such as tomorrow theme). I opened a pull request on the solarized theme (altercation/solarized#240) but it causes other issues so I’m thinking maybe it’s more of a problem with the apps themselves then with the theme.

I’m not sure 90 maps to which color... I’m guessing it’s black?

@tj
Copy link
Contributor

tj commented Apr 29, 2013

solarized is strange and for some reason does not display gray, but this is a theme problem

@tj tj closed this as completed Apr 29, 2013
@ghost
Copy link

ghost commented Apr 29, 2013

@visionmedia stupid question maybe but where can I find the meaning of the numbers you use for colors? 90, 31, 92..... I couldn’t find. 90 means gray?

@necolas
Copy link
Author

necolas commented Apr 29, 2013

This is disappointing. The issue can be easily fixed by changing a color value in Mocha. We did it for Bower. I can't see the point in not making a small change when a lot of people use Solarized, and a non-breaking fix in the theme itself is extremely non-trivial. I hope you'll reconsider. Thanks

@necolas
Copy link
Author

necolas commented May 1, 2013

Seems that other themes also experience this problem - altercation/solarized#220 (comment)

Bower and (I think) Yeoman changed their colors to avoid theme problems with this gray. Hopefully you'll consider making this small change to Mocha too.

@ghost
Copy link

ghost commented May 1, 2013

I've done a bit of research and it really seems more like a theme problem. I patched the solarized iterm2 and vim themes on my end to fix the problem, just not sure it is the right/best solution.

@tj
Copy link
Contributor

tj commented May 1, 2013

It's definitely a theme problem, I don't want to code around themes.

@necolas
Copy link
Author

necolas commented May 1, 2013

Obviously. But other tools have made a simple change to avoid the problem, which is not unique to Solarized.

@ghost
Copy link

ghost commented May 2, 2013

@necolas Try using the colors module (https://github.com/Marak/colors.js) and do:

console.log("hello world".grey);

You’ll get invisible text in solarized which doesn’t make sense. It’s not like there are a thousand ways to do this either. Grey should be grey no matter what theme you use I’d say.

Feel free to try out my fork at https://github.com/hydrozen/solarized. I tweaked the iTerm2 and vim themes slightly.

@necolas
Copy link
Author

necolas commented May 2, 2013

Yeah, colors.js's grey is what was responsible for the problem in Bower. But there's more than one color of grey. We just got rid of it for the sake of end users. Anyway, hopefully Ethan can get a fix into Solarized since TJ has closed this issue.

@amarshall
Copy link

For those who don’t want to modify Solarized (as it may break other applications, e.g. Vim), and don’t want to modify Mocha itself, you can pretty easily replace all the escape codes in question with perl/sed and some creative Bash redirecting (I replaced the problem color code with 92, which seems to work well in standard Solarized Dark):

mocha -c "$@" > >(perl -pe 's/\x1b\[90m/\x1b[92m/g') 2> >(perl -pe 's/\x1b\[90m/\x1b[92m/g' 1>&2)

Not to hard to make a wrapper function that encapsulates this and handles args (function is easier so you can still lookup the real one in the $PATH). Might as well include my function here (Zsh & Bash compatible):

mocha() {
  if type whence &> /dev/null; then
    mocha=$(whence -p mocha)
  else
    mocha=$(type -P mocha)
  fi
  substitution='s/\x1b\[90m/\x1b[92m/g'

  $mocha -c "$@" > >(perl -pe "$substitution") 2> >(perl -pe "$substitution" 1>&2)
}

I’ve since replaced this with a bash script rather than function so it gets picked up better by other commands.

@tj
Copy link
Contributor

tj commented May 22, 2013

pretty sure vim works fine with other themes :p I fail to see how displaying gray would have any effect on that

@amarshall
Copy link

Changing the color associated with ANSI escape code 90 in Solarized Dark (so one can see Mocha’s output) breaks Vim colors when using Solarized Dark, which may make changing the color a non-option. See altercation/solarized#240.

@tj
Copy link
Contributor

tj commented May 22, 2013

damn, that sucks, I guess "light black" could be interpreted many ways :S

@ghost
Copy link

ghost commented May 22, 2013

@amarshall I only had to do a minor tweak to the vim solarized dark theme theme to fix it in my branch. I don’t use vim a lot, but it seemed to fix it at first glance (if used with my fixed version of solarized dark for iterm). See https://github.com/hydrozen/solarized/commit/13d13ea3ee5060c90baa650d6db7c2bd01dac33d.

@ghost
Copy link

ghost commented May 22, 2013

@amarshall I just checked, It seems pretty close, but there are still some glitches in the vim theme. For example, the class/end keywords still have a gray background.

The author of solarized said he was going to look into it when Paul Irish stepped in... still waiting though..

@amarshall
Copy link

@visionmedia I don’t even know what this is called, I’ve seen 90 referred to as bright black, light black, and dark grey. It’s non-standard anyway, which is probably part of the issue.

@Hydrozen Indeed, and I’d rather avoid bugs elsewhere and instead “fix” Mocha’s output. It’s been nearly two years since I saw this same issue but with RSpec’s output, and it only got fixed because RSpec changed, not Solarized.

@tj
Copy link
Contributor

tj commented May 22, 2013

I use 90 everrrrrywhere haha, all my code is doomed

@amarshall
Copy link

@visionmedia 🙈 it just keeps the Perl monkeys at work ;)

@ghost
Copy link

ghost commented May 22, 2013

@amarshall I pushed another commit on my branch which seems to help. So with the iterm2 theme and vim theme from my branch, there’s no invisible output from mocha and terminal vim looks like this with ruby code:

screen shot 2013-05-22 at 12 04 01 am

If you use vim a lot than you could confirm if my fix seems to work or not. Also, I’d be curious to see the commit where rspec fixed that issue.

@amarshall
Copy link

@Hydrozen See rspec/rspec-core#393.

@mbrevda
Copy link

mbrevda commented Sep 8, 2013

As per altercation/solarized#164, this is easly fixed by uping the contrast in iterm2 (I found a about a third from the left to be optimal)

@knownasilya
Copy link

@mbrevda thanks for the simple solution.

@actionshrimp
Copy link

Not a solution but this will 'patch' mocha to update the colours to a more solarized-friendly version. Run it in your working directory after an npm install to affect local versions of mocha, or in /usr/lib/node_modules (on my unix machine at least) to affect a global install of mocha.

https://github.com/actionshrimp/dotfiles/blob/master/utils/patch-mocha-colors

@majimboo
Copy link

majimboo commented Aug 4, 2014

+1

@boneskull
Copy link
Member

locking; please file a ticket here

fwiw I use "Solarized Darcula" on iTerm 2 and have no problems.

@mochajs mochajs locked and limited conversation to collaborators Aug 5, 2014
carljm added a commit to carljm/dotfiles that referenced this issue Dec 15, 2014
Fixes by changing brblack to base01, instead of background color.

See mochajs/mocha#802 and
altercation/solarized#220 and many other issues...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants