Open nooitaf opened 8 years ago
Strange. The function you linked to is a line-for-line port of the xterm perl script which generates its color macros. I'll take another look at it.
I may have just run into this issue while working in a tmux session, I'm running some mocha tests using pty.js and adding the output to a blessed box.
When I run the tests using mocha directly (all default options) or directly log the pty.js output to process.stdout, the test titles get printed in grey.
However if I add the report to a blessed box, the grey text is rendered in black (I usually have a black background).
I suspect I'll be able to find a tmux option (maybe the terminal type or something) to work around this, as I can see that it works fine outside a tmux session in the same terminal. However it's only broken inside a tmux session when using a blessed box to render the output.
As i suspected. If I export TERM=xterm-256color
in my tmux session then all is well and I get grey text. It seems the default TERM for tmux is screen
. However this still seems like a bug in blessed as the grey text is rendered fine with TERM set to screen
when not using blessed.
Should I open a separate issue? this may not be the same as raised, or it could just be another clue as to what's wrong
Oh and in case anyone lands here looking for the tmux option I used:
set -g default-terminal xterm-256color
After a while of desperately trying to find a bug in my code i did a little gradient test and saw this.
This happens on every terminal i tried it on (osx xterm+terminal,debian xterm) so i ruled out local settings.
I tried to look at
/lib/colors.js
https://github.com/chjj/blessed/blob/master/lib/colors.js#L285 and played with some values. After i changed+ 8
to+ 0.01
and got some more characters working...... but its not in anyway a solution, but it might send someone else on the right path ^^.