mellowcandle / bitwise

Terminal based bit manipulator in ncurses
GNU General Public License v3.0
650 stars 28 forks source link

Wrong colors when inside a terminal multiplexer (tmux) #39

Open flvcst opened 5 years ago

flvcst commented 5 years ago

Whenever I open bitwise inside tmux my default colors are swapped to black foreground on white background. I do believe that's because some color resetting[1] happening after we call start_colors(). I've found two solutions:

1) calling use_default_colors() after start_color() in src/misc.c 2) calling init_pair(0, COLOR_WHITE, COLOR_BLACK) in src/interactive.c

I think 1) is the right way to deal with this problem because it will respect whatever colorscheme is being used. It's trivial to change, should I make a pull request?

[1] curs_color(3X) says that It restores the colors on the terminal to the values they had when the terminal was just turned on.

mellowcandle commented 5 years ago

It used to have use_default_colors() but I removed it because people complained. see here. https://github.com/mellowcandle/bitwise/commit/a30acc9181620a54b1c8cd3c651204a43e7eaa2d

mellowcandle commented 5 years ago

I don't recall what was the initial problem. I will test it in a side branch and rethink it for next release.

mellowcandle commented 5 years ago

Thanks for raising the issue.