morhetz / gruvbox

Retro groove color scheme for Vim
13.79k stars 1.11k forks source link

Airline theme wrong colors in tmux #233

Closed persep closed 6 years ago

persep commented 6 years ago

This is my vi in the terminal: Imgur

And this is the same vi inside tmux: Imgur

The colors from the default airline theme are changed. My .vimrc is:

" Plugins will be downloaded under the specified directory.                                     
call plug#begin('~/.vim/plugged')                                                               

" Declare the list of plugins.                                                                  
Plug 'vim-airline/vim-airline'                                                                  
Plug 'morhetz/gruvbox'                                                                          

" List ends here. Plugins become visible to Vim after this call.                                
call plug#end()                                                                                                                                                                               
set number      "Precede each line with its line number                                        
syntax enable   "Enable syntax highlighting                                                    
set background=dark                                                                            
colorscheme gruvbox                                                                            
set t_ut=                                                                                      
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"                                                         
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"                                                         
set termguicolors

Both return gruvbox to the command :AirlineThemeoutside and inside tmux. $TERM is xterm-256color in the terminal and tmux-256color inside tmux. I's using Vim 8 1567 and tmux 2.1 (also tried tmux 2.6 but I got the same problem) in Ubuntu for windows

horseinthesky commented 6 years ago

Add this to your .tmux.conf

set -g default-terminal "screen-256color"

Should fix

persep commented 6 years ago

Thanks for your suggestion but as I said the $TERM variable already shows screen-256colorand I also tried tmux-256color but didn't work . Anyway , my .tmux.conf is:

set -g default-terminal "screen-256color"               
set -sg escape-time 0                                                                           

Also tried with "tmux-256color" but din't work

persep commented 6 years ago

It look like I'm not the only one https://github.com/morhetz/gruvbox/issues/98#issuecomment-317405479

morhetz commented 6 years ago

@persep that's tmux issue unrelated to gruvbox mind if I close this issue as a duplicate of #98? I would like to help you with this one though unfortunately I don't have enough spare time

persep commented 6 years ago

ok go ahead

HarrisonLee1998 commented 4 years ago

Add this to your .tmux.conf

set -g default-terminal "screen-256color"

Should fix

it works!

nicoandresr commented 4 years ago

At least works after hours trying, the solutions added this to my .tmux.conf

set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",*256col*:Tc"