The terminal i'm using is termite, and it is very good, but i'm having a problem with vim colorschemes and some colors in the terminal itself too when using tmux. It happens as follows: Right = no tmux; Left = tmux As you can see in the screenshot, when i open nvim or vim with tmux, the case on the left, the colorscheme gets altered, this happens with all colorschemes i tested (about 15 or 20). I observed, that when i execute the command TERM=xterm-256color tmux right after i enter termite, the nvim/vim (i simlinked my .vimrc, so it is the same as init.vim) colorschemes works like a charm! I'm using i3-gaps, so, i decided to set the binding, $mod+Return to open termite that way:

  • bindsym $mod+Return exec termite -e 'TERM=xterm-256color tmux'

It should have worked, but when i press the keys, the screen only blinks and nothing happens.

Things i've tried include:

  • Set $TERM to various values, both in termite, in ~/.tmux.conf.local and in my .vimrc: xterm-256color, screen-256color, termite-256color;

  • Tested the same thing with other terminal emulators, like xfce-terminal and gnome-terminal, in both it works normally, and the colors get displayed correctly;

  • Set in my .vimrc:

    `if &term == "screen"` 
        `set t_Co=256`
  • Starting tmux with tmux -2;

  • Aliasing in my .zshrc:

    tmux="tmux -2";
    tmux="TERM=xterm-256color tmux" (screen blinks and nothing happens);
    termite="termite --exec "TERM=xterm-256color tmux";
    termite="termite -e "TERM=xterm-256color tmux".

Edit: The $TERM inside and outside tmux continue to be the same as the terminal. It outputs the same thing when I echo $TERM inside and outside tmux. This happened with termite, have to test it with other terminals.

  • What's the TERM value set to in tmux? you may need to specify to tmux that it's using a 256 color capable terminal, as well as letting termite know. – Tim Kennedy Oct 17 '18 at 12:10
  • The TERM in tmux is screen-256color. I read in the FAQ, that is not recommend to set it to anything else, I tried, anyway, to set it to other values, with no success. – Erick César Oct 17 '18 at 13:35

For the ones with a similar problem or the same one here it goes: you just need to set the $TERM variable to be the same in your .rc and in .tmux.conf files. To know if something is wrong, i recommend using :checkhealth command inside neovim.


I'm using these configurations in my ~/.tmux.conf file, should works with you also:

set -g terminal-overrides ',xterm-256color:Tc'
set -g default-terminal "tmux-256color"
set -as terminal-overrides ',xterm*:sitm=\E[3m'
  • I tested it now, it doesn't worked... :( – Erick César Oct 17 '18 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.