I am using Ubuntu 18 LTS, with gnome-terminal.
Normally - set termguicolors does its job by generally enhancing the look of VIM. However, if I use tmux, then VIM looks off and "set termguicolors" completely breaks all highlighting.
Note - I'm not using a colorscheme, this just my terminal's color scheme.
Before termguicolors:

After termguicolors:

However, tmux breaks set termguicolors
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
Solution:
Add the following lines before "set termguicolors" into my .vimrc:
" This is only necessary if you use "set termguicolors". It ensures the last screenshot does not occur
let &t_8f = "<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "<Esc>[48;2;%lu;%lu;%lum"
" fixes glitch? in colors when using vim with tmux
set background=dark
set t_Co=256
Closed #3608.
With the latest tmux version next-3.3, I did not need to make any changes in vimrc (I kept termguicolors only enabled), but added the following in tmux, and it worked for me:
# tmux colors
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:Tc"
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
*tmux*
When using tmux you may want to use this in the tmux config: >
# tmux colors
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:Tc"
Let me know if something needs to be changed.
Maxim Kim wrote:
> > *tmux*
> > When using tmux you may want to use this in the tmux config: >
> > # tmux colors
> > set -g default-terminal "xterm-256color"
> > set -ag terminal-overrides ",xterm-256color:Tc"
> >
> > Let me know if something needs to be changed.
> >
> >
> >
> This works for me too (on debian):
>
> set -g default-terminal "tmux-256color"
> set -ag terminal-overrides ',*:RGB'
OK, so which one of the two should we recommend?
> The newest version of ncurses ships with a tmux-256color terminfo entry (the FAQ does mention this). 
> As an example, a benefit of using tmux-256color over screen-256color is that italics is properly rendered (screen doesn't support italics).
> So if you are using tmux 2.6 or above, and have the latest ncurses package, the following will work as well:
> set -g default-terminal "tmux-256color"
OK, so which one of the two should we recommend?
@vedantroy life-changing oh my gosh. My vim looks so much nicer.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
