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

Closed
necolas opened this Issue Apr 10, 2013 · 27 comments

Comments

Projects
None yet
9 participants
@necolas

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

This comment has been minimized.

Show comment
Hide comment
@kevva

kevva Apr 10, 2013

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

kevva commented Apr 10, 2013

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

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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?

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

This comment has been minimized.

Show comment
Hide comment
@tj

tj Apr 29, 2013

Contributor

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

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 Apr 29, 2013

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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?

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

This comment has been minimized.

Show comment
Hide comment
@necolas

necolas 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 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

This comment has been minimized.

Show comment
Hide comment
@necolas

necolas 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.

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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.

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

This comment has been minimized.

Show comment
Hide comment
@tj

tj May 1, 2013

Contributor

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

Contributor

tj commented May 1, 2013

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

@necolas

This comment has been minimized.

Show comment
Hide comment
@necolas

necolas May 1, 2013

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

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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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.

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

This comment has been minimized.

Show comment
Hide comment
@necolas

necolas 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.

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

This comment has been minimized.

Show comment
Hide comment
@amarshall

amarshall May 22, 2013

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.

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

This comment has been minimized.

Show comment
Hide comment
@tj

tj May 22, 2013

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@amarshall

amarshall May 22, 2013

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.

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

This comment has been minimized.

Show comment
Hide comment
@tj

tj May 22, 2013

Contributor

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

Contributor

tj commented May 22, 2013

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

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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 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

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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..

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

This comment has been minimized.

Show comment
Hide comment
@amarshall

amarshall May 22, 2013

@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.

@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

This comment has been minimized.

Show comment
Hide comment
@tj

tj May 22, 2013

Contributor

I use 90 everrrrrywhere haha, all my code is doomed

Contributor

tj commented May 22, 2013

I use 90 everrrrrywhere haha, all my code is doomed

@amarshall

This comment has been minimized.

Show comment
Hide comment
@amarshall

amarshall May 22, 2013

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

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

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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.

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

This comment has been minimized.

Show comment
Hide comment

@hydrozen See rspec/rspec-core#393.

@jackfranklin jackfranklin referenced this issue in tgvashworth/distra Jun 15, 2013

Closed

Bug with themes? #4

@mbrevda

This comment has been minimized.

Show comment
Hide comment
@mbrevda

mbrevda 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)

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

This comment has been minimized.

Show comment
Hide comment
@knownasilya

knownasilya Jan 9, 2014

@mbrevda thanks for the simple solution.

@mbrevda thanks for the simple solution.

@actionshrimp

This comment has been minimized.

Show comment
Hide comment
@actionshrimp

actionshrimp Mar 5, 2014

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

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

This comment has been minimized.

Show comment
Hide comment

majimboo commented Aug 4, 2014

+1

@boneskull

This comment has been minimized.

Show comment
Hide comment
@boneskull

boneskull Aug 5, 2014

Member

locking; please file a ticket here

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

Member

boneskull commented Aug 5, 2014

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

Fix invisible text in Mocha output.
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.