Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS + alacritty + tmux + vim = color issue #18

Closed
pbnj opened this issue Dec 30, 2020 · 1 comment
Closed

macOS + alacritty + tmux + vim = color issue #18

pbnj opened this issue Dec 30, 2020 · 1 comment

Comments

@pbnj
Copy link
Contributor

pbnj commented Dec 30, 2020

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:

Screen Shot 2020-12-30 at 11 13 28 AM

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:

Screen Shot 2020-12-30 at 11 20 19 AM

@MaxSt
Copy link
Collaborator

MaxSt commented Dec 31, 2020

❤️ Thank you 👍 , I added this information to the readme and linked this issue.

@MaxSt MaxSt closed this as completed Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants