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

Colors don't appear right inside tmux #69

Closed
nerdpad opened this issue Dec 21, 2016 · 4 comments
Closed

Colors don't appear right inside tmux #69

nerdpad opened this issue Dec 21, 2016 · 4 comments

Comments

@nerdpad
Copy link

nerdpad commented Dec 21, 2016

I previously thought this may be happening because my tmux didn't have TrueColor support enabled properly. I resolved my tmux TrueColor issue tmux/tmux#696, but my vim colors still do not match:

Relevant vimrc

if &term =~ '256color'
    " disable background color erase
    set t_ut=
endif

" enable 24 bit color support if supported
if (empty($TMUX) && has("termguicolors"))
    set termguicolors
endif

let g:onedark_termcolors=256
let g:onedark_terminal_italics=1

syntax on
set t_Co=256                  " Explicitly tell vim that the terminal supports 256 colors
set background=dark           " Enable dark background
colorscheme onedark           " Set the colorscheme

NeoVim Version

⇨ nvim --version
NVIM 0.1.7
Build type: RelWithDebInfo
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/tmp/neovim-20161130-73384-ctpyvy/neovim-0.1.7/build/config -I/tmp/neovim-20161130-73384-ctpyvy/neovim-0.1.7/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/usr/include -I/tmp/neovim-20161130-73384-ctpyvy/neovim-0.1.7/build/src/nvim/auto -I/tmp/neovim-20161130-73384-ctpyvy/neovim-0.1.7/build/include
Compiled by user@77979797-mac.local

Optional features included (+) or not (-): +acl   +iconv    -jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.1.7/share/nvim"

Screenshot

Left: iTerm > tmux > nvim
Right: iTerm > nvim

Noticeable Problems:

  • Background color doesn't match. Background color of nvim running within tmux has a darker tone
  • Normally all colors look more contrasted (colors on left eg: pink, red, etc. are darker inside tmux

screen shot 2016-12-21 at 6 06 12 pm 3

@joshdick
Copy link
Owner

Your .vimrc contains this line:

if (empty($TMUX) && has("termguicolors"))

Does everything work if you change it to:

if (has("termguicolors"))

@nerdpad
Copy link
Author

nerdpad commented Dec 21, 2016

@joshdick OMG! Yes, that solved the issue.

But if you don't mind can you please tell me, when the termguicolors is supposed to be set?

@nerdpad
Copy link
Author

nerdpad commented Dec 21, 2016

It's okay, I think I understand now that set termguicolors was not being called inside tmux session.

Thank you for the help.

@nerdpad nerdpad closed this as completed Dec 21, 2016
@joshdick
Copy link
Owner

You're welcome! Keep in mind that this config will cause problems if you use tmux on multiple machines where only SOME machines have true-color set up -- every machine where you use tmux needs to have true-color configured.

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

No branches or pull requests

2 participants