macOS + alacritty + tmux + vim = color issue
pbnj opened this issue · 1 comments
pbnj commented
I just ran into some coloring issue that I wanted to share, and perhaps contribute some troubleshooting tips in the docs.
Problem
When using vim in alacritty & tmux on macOS, colors were completely off in vim:
I was not able to replicate the issue using iTerm2 + tmux + vim.
Here are the relevant settings I had for alacritty, tmux, and vim:
Alacritty
Per the official repo:
# ...
# challenger deep
colors:
# Default colors
primary:
background: '0x1b182c'
foreground: '0xcbe3e7'
# Normal colors
normal:
black: '0x100e23'
red: '0xff8080'
green: '0x95ffa4'
yellow: '0xffe9aa'
blue: '0x91ddff'
magenta: '0xc991e1'
cyan: '0xaaffe4'
white: '0xcbe3e7'
# Bright colors
bright:
black: '0x565575'
red: '0xff5458'
green: '0x62d196'
yellow: '0xffb378'
blue: '0x65b2ff'
magenta: '0x906cff'
cyan: '0x63f2f1'
white: '0xa6b3cc'
Tmux
# ...
set-option -g default-terminal "xterm-256color"
# ...
Note: I'm not using the official tmux theme. See my dotfiles for the full config.
vim
Per the official repo:
" ...
Plug 'https://github.com/challenger-deep-theme/vim', { 'as': 'ChallengerDeep' }
" ...
if has('nvim') || has('termguicolors')
set termguicolors
endif
colorscheme challenger_deep
" ...
Solution
Research led me to this reddit thread.
What solved it for me was setting the following tmux config option:
# ...
set-option -g default-terminal "xterm-256color"
+ set-option -ga terminal-overrides ',xterm-256color:Tc'
# ...
Here is what vim looks like in alacritty + tmux on macOS now:
MaxSt commented
❤️ Thank you 👍 , I added this information to the readme and linked this issue.