Forcing Tmux to use 256 colors

I’ve been messing around with my terminal display, trying to church it up a little.  I tried Powerline, but didn’t have great luck with it.  So, I’m going old school and just adjusting conf files for the applications that I use all the time, mainly tmux and vim.  I’ve been banging my head against tmux all day.  I added some flashy stuff to the tmux statusline, but I just could NOT get the colors right.  I know that there are lots of settings and tweaks for getting 256 color support right, but no matter what I did, I couldn’t get tmux to display properly.

I finally ran across a random forum post from a couple of years ago.  Basically, my terminal (XFCE terminal) is set up for 256 colors, but tmux always starts with the default of 80 colors.  The answer?  Instead of starting tmux with

tmux

I just start it with

tmux -2

which forces tmux to run with 256 color support.  Problem solved, and my badass statusline is working perfectly.

Tmux without 256 color support.

Tmux started normally, displaying a limited color pallette.

 

Tmux started with 256 color support.

Tmux started with the “-2” parameter, forcing 256 color support.