edkolev/tmuxline.vim

True colors not supported

Opened this issue · 7 comments

Tmux & Vim has true color support.

image

image

I can confirm. I had to :TmuxlineSnapshot without enabling termguicolors and hardcoding tmux to load this in order for it to show up properly. Doing set notermguicolors and attempting to re-run TmuxLine does not seem to fix this either. Once set termguicolors is done your done ;)

# NOTE: Powerline glyph removed
# Good Snapshot
set -g status-left "#[fg=colour193,bg=colour65] #S #[fg=colour65,bg=colour237,nobold,nounderscore,noitalics]"

# Bad Snapshot (set termguicolors)
set -g status-left "#[fg=,bg=] #S #[fg=,bg=,nobold,nounderscore,noitalics]"

FYI, here is my current hack. Yeah running vim at the beginning of every session takes a second or two but luckily this only happens once.

~/.vimrc

if empty($TMUX_SET_STATUSLINE)
  let g:airline#extensions#tmuxline#enabled = 0
  if has('termguicolors')
    set termguicolors
  endif
else
  let g:airline#extensions#tmuxline#enabled = 1
endif

~/.tmux.conf

run-shell '[ -d ~/.vim/plugged/tmuxline.vim ] && env TMUX_SET_STATUSLINE=1 vim -c "Tmuxline airline" -c "q"'

With the following configuration on ~/.vimrc, the status line looks much better. You can choose vim_statusline_1, vim_statusline_2 or vim_statusline_3.

if exists('$TMUX')
    autocmd VimEnter * call tmuxline#set_statusline('vim_statusline_3')
endif

Taken from this link

Only works when working with vim, tmuxline changes when vim leaves the panel.

FYI I found this fork which seems to work with true colors (at least for me):

https://github.com/weihanglo/tmuxline.vim

@CPWeaver Thanks for sharing! weihanglo's fork worked for me as well.

It seems like weihanglo/tmuxline.vim is no longer available... Is it needed yet?

I believe the termguicolors PR #93 fixed it. It is working great for me at least.