Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The command bar is purple #15

Closed
AffanIndo opened this issue Nov 3, 2017 · 9 comments
Closed

The command bar is purple #15

AffanIndo opened this issue Nov 3, 2017 · 9 comments

Comments

@AffanIndo
Copy link

AffanIndo commented Nov 3, 2017

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
Copy link
Author

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
Copy link
Contributor

arcticicestudio commented Nov 3, 2017

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
Copy link
Author

AffanIndo commented Nov 4, 2017

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
Copy link
Contributor

Nice to see that it fixed your problem 😄

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
Copy link
Author

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

@arcticicestudio
Copy link
Contributor

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
Copy link

pannnnn commented May 5, 2019

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
Copy link
Contributor

@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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants