Getting 256 colors to work in tmux
I have 256 colors working just fine in
konsole,. I thought I'd give
tmuxa try because, unlike screen, it seems to support
vimode. However I find that the colors of my prompt show up and this is most likely because I have a 256 color mode prompt. What do I need to do to get
tmuxto recognize all 256 colors?
The Tmux FAQ explicitly advises against setting TERM to anything other than screen or screen-256color in your shell init file, so don't do it!
Here's what I use:
~$ which tmux tmux: aliased to TERM=xterm-256color tmux
and in in my .tmux.conf:
set -g default-terminal "screen-256color"
tmux -2" should also do the trick.
I like the way to set it in the .tmux.conf best... using the shell to set it just doesn't seem right
Weird. You don't need `tmux -2` on OSX but you need it with Gnome Terminal. Thanks for the info, added to my aliases!
In Kubuntu 13.10 the .tmux.conf setting alone did not get me my 256 colors back (which took out highlighting in vim visual mode) but the alias worked. Would certainly prefer a .tmux.conf file only solution.
ssh'd into an Ubuntu machine (from OS X Terminal), the .tmux.conf default-terminal was all I needed.
Here is a relevant ticket: http://sourceforge.net/p/tmux/tickets/67/ ("tmux always sets TERM=screen"). There is an entry in `TODO` (source): "use screen-256color when started on 256 colour terminal?"
for me it seems like all I need to do is `TERM=screen-256color tmux` without creating a `.tmux.conf` file. Am I missing something?
256 color reference: https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg set status-bg colourX
Thank you very much for this. I was going crazy because text of some applications was being rendered as black text on a black background.