I know there are many blog posts about configuring Tmux to support true color and italics in Alacritty, but many of them miss a crucial detail that breaks Neovim’s diagnostic undercurl (wavy underlines).
Many of them suggest overriding the TERM variable in Alacritty to xterm-256color, which causes Neovim to lose the ability to display undercurl correctly.
Many of them are also outdated or incomplete.
This is how I configured Tmux and Alacritty to work perfectly together, supporting true color, italics, and Neovim’s undercurl diagnostics.
The Problem
When using Tmux inside Alacritty, you may encounter several issues:
- No True Color Support: Colors may appear washed out or limited to 256 colors instead of the full 24-bit RGB spectrum
- Italics Not Working: Italic fonts don’t render correctly, or reverse video appears instead
- Neovim Diagnostic Undercurl: Neovim’s diagnostic undercurl (wavy underlines) shows as simple underlines instead
These issues stem from incorrect TERM environment variable configuration and missing terminal capability overrides.
For example, using the shell script linked below to check true color support, when it’s not working, you get (left: Tmux inside Alacritty, right: Alacritty by itself):
When it works, you get:
The Solution
1. Alacritty Configuration
DO NOT override the TERM variable in Alacritty. Leave it at the default value alacritty.
|
1 2 3 4 5 |
# DON'T DO THIS or Neovim will not show undercurl correctly (only underline) # Leave the default value, which is `alacritty` # [env] # TERM = "xterm-256color" |
Why? Alacritty’s default TERM=alacritty includes the terminfo capabilities for undercurl, which Neovim needs to display diagnostic wavy underlines. Setting it to xterm-256color breaks this feature.
2. Tmux Configuration
Add the following lines to your ~/.tmux.conf:
|
1 2 3 4 5 |
# Enable 256-color and true-color (24-bit) support in tmux # And also italics set -g default-terminal "tmux-256color" set -ga terminal-overrides ",*:Tc" |
Explanation:
– default-terminal "tmux-256color": Sets tmux to use a terminal type that supports 256 colors and italics
– terminal-overrides ",*:Tc": Tells tmux to enable true-color (24-bit RGB) support for all terminal types that support it
3. Why This Works
When you start tmux inside Alacritty:
– Alacritty sets TERM=alacritty (which supports true color and undercurl)
– Tmux creates a new environment with TERM=tmux-256color (which supports italics)
– The terminal-overrides setting tells tmux to pass through true-color escape sequences from the outer terminal (Alacritty)
This combination gives you:
– True color (24-bit RGB) support
– Italic fonts working correctly
– Neovim undercurl diagnostics rendering properly
Verification
To verify everything works:
Check true color support:
|
1 2 |
curl -s https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh | bash |
Check italics:
|
1 2 |
echo -e "\e[3mThis text should be italic\e[0m" |
Check in Neovim:
- Open a file with syntax errors or any diagnostics (including spelling errors)
- You should see wavy underlines (undercurl) for diagnostics, not simple underlines










































