nordtheme / tmux

An arctic, north-bluish clean and elegant tmux color theme.
https://www.nordtheme.com/ports/tmux
MIT License
1.07k stars 141 forks source link

The command bar is purple #15

Closed AffanIndo closed 6 years ago

AffanIndo commented 6 years ago

The tab bar has nord colorscheme, but the command bar has this purple color powerask This happened in rxvt-unicode, xfce terminal and xterm.

AffanIndo commented 6 years ago

screenshot from 2017-11-03 20-17-26 My split pane color became purple too even though on the .tmux.conf it is set to cyan. This only happened when I activate nord-tmux plugin

arcticicestudio commented 6 years ago

Does your terminal support 24-bit True color and which tmux version are you running? tmux supports 24-bit True color since version 2.2.

urxvt for example is know to parsing ANSI color sequences, but approximating them to 256 palette.

Please start tmux and run

tmux info | grep Tc

If the output is Tc: (flag) true your tmux supports true color, otherwise the output Tc: [missing] indicates that tmux has no True color support.

You can run this inside tmux to test the 24-bit colors:

awk 'BEGIN{
    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
    for (colnum = 0; colnum<77; colnum++) {
        r = 255-(colnum*255/76);
        g = (colnum*510/76);
        b = (colnum*255/76);
        if (g>255) g = 510-g;
        printf "\033[48;2;%d;%d;%dm", r,g,b;
        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
        printf "%s\033[0m", substr(s,colnum+1,1);
    }
    printf "\n";
}'

If the line looks "stepwise" tmux does not use 24-bit True color:

gh-15-scrot-no-24bit-true-color

Otherwise the line should have smooth transitions:

gh-15-scrot-24bit-true-color

The $TERM environment variable is important for tmux as also clarified in the official tmux FAQ. The variable must be initialized with a terminal that supports 256 colors (*-256color). More information about 24-bit color terminal support can be found in the awesome Arch Linux Wiki.

If your terminal supports True color you should make sure to set the terminal-overrides and default-terminal options in your ~/.tmux.conf:

set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"

This will reflect your actual $TERM outside of tmux and enables full compatibility.

Replace the xterm-256color with your desired terminal e.g. rxvt-unicode-256color. Make sure to include the important Tc terminfo extension flag!

If this doesn't fix the colors or causes other problems try to remove the default-terminal option so only the terminal-overrides values are applied.

AffanIndo commented 6 years ago

screenshot from 2017-11-04 16-01-24 Yeah, you're right. Previously I have Tmux 2.1 and no Tc. But now I compiled 2.6 and it works. But the Awk thingy become weird (and it blinking) even though my problem has fixed. Is this normal?

Also I did the set-option -ga terminal-overrides ",rxvt-unicode-256color:Tc" but when I do echo $TERM it shows xterm-256color. Is that supposed to be like that?

arcticicestudio commented 6 years ago

Nice to see that it fixed your problem :smile:

The weird output might be related to some implementation details regarding the escape codes (033, \e) or some awk version incompatibilities, but as long as this problem is only limited to the test code you can ignore it.

Have you tried to logout from the current session and check again after login? The $TERM env is loaded on login so the change can not be tested on-the-fly.

AffanIndo commented 6 years ago

Yea, still weird. But my problem's fixed anyway :) thanks. Just the True color thingy

arcticicestudio commented 6 years ago

Maybe there's another compatibility problem with urxvt. You can check out the awesome Gist about Colours in terminal that covers almost all topics and includes a lot of troubleshooting documentation.

pannnnn commented 5 years ago

The command bar is yellow. And I have smooth transitions printed out by the command line you provided. And 'tmux info | grep Tc' is set correctly. The only thing that I think that could possibly cause this problem is that I am using Alacritty which is not in the installation list before installing Nord tmux. Could you please help me with this? That would be really appreciated

arcticicestudio commented 5 years ago

@pannnnn Can you please try to reproduce the problem with a clean Vim config that only contains the activation for the colorscheme but nothing else like plugins, settings or global variables?

arcticicestudio commented 5 years ago

@pannnnn Any updates on this? Have you been able to reproduce the problem with a clean config? Also I must have overlooked that you wrote you're using Alacritty, but couldn't find a matching terminal color scheme in the list. There is Nord Alacritty and it is required to be installed when you're using Alacritty, otherwise the root cause of your problem is that the Nord colors are simply not available and instead the color your currently active theme is used which might use a different color ordering.