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. Configure tmux for true color
- In ~/.tmux.conf add set -g default-terminal "tmux-256color"
- Add set -ga terminal-overrides ",xterm-256color:Tc"
- Kill all tmux sessions (tmux kill-server) and start again
2. Tell Vim the true-color escape codes
- 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)
- Put set termguicolors before the colorscheme line
3. Test true color outside Vim
- Run a true-color test script in the terminal with and without tmux
- If it fails outside Vim too, remove set termguicolors and use a 256-color scheme
4. Rule out plugins
- Start Vim with a minimal vimrc containing only the colorscheme and termguicolors
- 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
- How to Exit Vim (Stuck in Vim)
- Vim Copy to Clipboard Not Working
- Vim E325: ATTENTION Found a Swap File
- Vim E212: Can't Open File for Writing
- Vim E37: No Write Since Last Change
- Vim Backspace Not Working in Insert Mode
- Vim Paste Indentation Messed Up (Staircase Effect)
- Why Is Vim So Slow? (Large Files & Long Lines)
- Vim Arrow Keys Insert A B C D
- Vim Requires Python 3 Support Error (YouCompleteMe)
- Vim Modeline Vulnerability CVE-2026-34982