chjj / blessed

A high-level terminal interface library for node.js.
Other
11.29k stars 534 forks source link

Gray gradient missing some colors #239

Open nooitaf opened 8 years ago

nooitaf commented 8 years ago

After a while of desperately trying to find a bug in my code i did a little gradient test and saw this.

screen shot 2016-04-04 at 09 00 10

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

screen shot 2016-04-04 at 09 08 38

... but its not in anyway a solution, but it might send someone else on the right path ^^.

chjj commented 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.

pghalliday commented 7 years ago

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.

pghalliday commented 7 years ago

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

pghalliday commented 7 years ago

Oh and in case anyone lands here looking for the tmux option I used:

set -g default-terminal xterm-256color