This should make true-color and italics work in your tmux session.
Tested successfully in bash and zsh with latest packages from Arch (with exception of Neovim from Git) 20019-07-07.
- Don't use
&t_8fand&t_8bin your vim config - Don't set
$TERMin your zshrc, bashrc, etc. Let your terminal set this. So farxterm-256colorhas worked best for me.
Running this script should look the same in tmux as without.
curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
bash 24-bit-color.sh
In ~/.config/alacritty/alacritty.yml:
env:
TERM: xterm-256color
In ~/.tmux.conf
This also works in other terminals
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
In ~/.vimrc or ~/.config/nvim/init.vim:
set termguicolors
You might have to set your colorscheme after this entry.