Vim Colors Wrong in tmux

Workaround available Linux, macOS Updated October 21, 2026

Quick answer

tmux isn't passing true color through. Set tmux's default-terminal and Tc override, and add t_8f/t_8b lines before termguicolors in your vimrc.

Most likely fix: Configure tmux for true color.

Symptoms

Colorscheme looks fine in the terminal but washed out, wrong, or missing background inside tmux; or colors break only after set termguicolors.

Why it happens

  • tmux default-terminal is 'screen' (256 colors, no true color)
  • Missing terminal-overrides for true color (Tc/RGB)
  • Vim doesn't know the escape codes for 24-bit color under tmux's TERM
  • termguicolors set in a terminal that doesn't support true color

How to fix it

Try these in order — the most common fix is first.

  1. 1. Configure tmux for true color

    1. In ~/.tmux.conf add set -g default-terminal "tmux-256color"
    2. Add set -ga terminal-overrides ",xterm-256color:Tc"
    3. Kill all tmux sessions (tmux kill-server) and start again
  2. 2. Tell Vim the true-color escape codes

    1. Add let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" and let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" to ~/.vimrc (semicolons, not colons)
    2. Put set termguicolors before the colorscheme line
  3. 3. Test true color outside Vim

    1. Run a true-color test script in the terminal with and without tmux
    2. If it fails outside Vim too, remove set termguicolors and use a 256-color scheme
  4. 4. Rule out plugins

    1. Start Vim with a minimal vimrc containing only the colorscheme and termguicolors
    2. Add plugins back until colors break

This guide also covers

  • vim colors wrong tmux
  • vim termguicolors tmux
  • vim colorscheme not working in tmux

Still not working?

If Vim keeps failing, you're not alone. See every Vim problem users report or the alternatives people switch to.

Other Vim errors