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

Not all colors are applied properly - kitty terminal #254

Closed
0xSigi opened this issue Mar 27, 2021 · 3 comments
Closed

Not all colors are applied properly - kitty terminal #254

0xSigi opened this issue Mar 27, 2021 · 3 comments

Comments

@0xSigi
Copy link

0xSigi commented Mar 27, 2021

Hi! I am using kitty and manually applying colorscheme using Nord Xresources colors, but when applying vim nord not all colors are right - the most noticeable difference is the one comments are rendered with, and the selection. Attaching screenshot for reference. I tried applying alacritty colorscheme but it looked even worse in this combination.. Any way I can manually try to change this one color? Tried to switch it inside the nord.vim file but it never respected the changes..
2021-03-27T16:32:18,319519951+01:00

@arcticicestudio
Copy link
Contributor

Hi @IronsideSec 👋

In order to ensure the problem is related to the Nord theme you need to reproduce it with a minimal and clean configuration. This can be done by creating new configuration file with any name (e.g. testrc) and run Vim with the following command: vim -u testrc
For me as a theme author it is not possible to know if the theme is the root cause of the problem when there are other attributes set in the configuration because each one might break the theme.

Here's an minimal test configuration you can use to try to reproduce the problem (supposed you're using 3):

call plug#begin(expand('~/.vim/plugged'))
Plug 'arcticicestudio/nord-vim'
call plug#end()

set nocompatible
if (has("termguicolors"))
  set termguicolors
endif

syntax enable
colorscheme nord

As you can see in the example configuration I've added the termguicolors settings which could be one reason why the color is not rendered correctly. This is because the *_term attributes make use of the colors that are provided by the terminal color scheme. The *_gui variables on the other side are used when Vim runs in GUI mode. So in order to run Vim in a terminal but use colors like in GUI mode the termguicolors variable must be set and your terminal emulator must support “true colors“ (24bit). This could fix the comment color not being brightened (see nordtheme/nord#94 for details) and the missing selection color.

It's also possible that you're using a terminal that doesn't work out-of-the-box with 24-bit colors so in order to use the termguicolors option some additional steps are required. For example, see nordtheme/emacs#59 (comment) which describes that the kitty terminal requires a extra terminfo file. What is the output when you run echo $TERM?
Maybe you'd also like to check out the great Gist about colors in terminals, there are many information why colors are still sometimes a pain in terminals.

Unfortunately terminal colors are quite complex due to their long history, but modern terminal emulators should be all capable of rendering "True Colors". You should make sure to check out the great “Terminal Colors“ gist that provides many details about color rendering in terminal emulators, tracking of supported terminal emulator projects and answers to common confusions about terminal colors. The “Colours in terminal“ gist is also quite helpful to learn more about the actual rendering engines and standards used by these terminal emulators.
There are also a lot of blog posts like this and this one that help to handle different use case with various terminal emulators in combination with different CLI and TUI applications.

Could you please try to either use the example configuration or set the termguicolors setting in your current configuration and check whether colors are then displayed correctly?

@arcticicestudio
Copy link
Contributor

@IronsideSec Have you been able to solve the problem? If yes it would be nice if you could summarize your solution to help others who are facing the same problem.

@arcticicestudio
Copy link
Contributor

Closing this issue for now due to inactivity, but feel free to reply if you have time again or if there are still open problems.

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

3 participants