I'm trying to figure out what's going on with my colors within vim in tmux. For some reason the colors seem correct everywhere except in vim. Every similar question I've found seemed to be resolved by setting TERM correctly in tmux and vim but that isn't working for me. In this case TERM is xterm-256color in both terminal sessions. I have tried it with TERM=screen-256color, and tried launching tmux with the "-2" option to force 256 color mode but get the same results.

The left image is vim inside tmux, right image is not. Color difference

  • I was having the same problem with gnome-terminal on Fedora. Please see this answer for the workaround I used to get consistent Vim colors both inside and outside of tmux. It may or may not be applicable to your use case. – Rusty Shackleford Mar 4 '17 at 1:44

Create a file named tmux-256color-italic.terminfo and do tic xterm-256color-italic.terminfo in the terminal. Then in the bashrc paste export TERM=xterm-256color-italic

tmux-256color-italic|tmux with 256 colors and italic,
    sitm=\ePtmux;\e\E[3m\e\\, ritm=\ePtmux;\e\E[23m\e\\,

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.