Hacker News new | past | comments | ask | show | jobs | submit login

The big problem I always have with tmux is that is messes up all of the colors in my Vim.



This is easily fixed by setting the appropriate terminal color settings in your bashrc. A quick google search will provide the answer.


Whatever TERM is set for you outside tmux needs to have a full ncurses terminfo with all the extended ncurses-specific codes. Assuming that screen and screen-256color on your system is similarly fully-featured with respect to ncurses, then you'll be in a good position. If you're lucky, TERM=screen-256color inside tmux and you're good to go.

Without that, there are a variety of hacks at different levels of the processing stack you can use to fix things. You could set TERM to screen.<your-terminal> if your system has the right settings for screen.<your-terminal>; or you could try setting it to <your-terminal> if <your-terminal> is sufficiently xterm-like.


You need to set your tmux.conf to use the correct term type. For modern distributions it should be

set -g default-terminal "tmux-256color"

You also need to make sure tmux understands that your terminal supports true color mode. Set the following if e.g. using gnome terminal (which calls itself xterm-256color in $TERM)

set-option -ga terminal-overrides ",256col:Tc"

You'll need to reset $TERM to something more standard if you plan to SSH to older systems, though. I have a shell function that wraps SSH and sets the term type to screen for when I log into old systems.


Try aliasing tmux to 'TERM=screen-256color tmux -2', I made my vim colors work. Just in case, excerpt from my vimrc :

  set background=dark
  set t_Co=16
  let g:solarized_termcolors=16
  colorscheme solarized




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: