Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recently started to use tmux and like it much, but it's green bottom bar is a bit distracting, is there a way to change its color? or a way to hide it?

share|improve this question

2 Answers 2

up vote 23 down vote accepted

There are many options given in the manual. (See the OPTIONS section.) Create an RC file: ~/.tmux.conf. The contents below enables UTF-8, sets the right TERM type, and draws the status bar with a black background and white foreground.

set status-utf8 on
set utf8 on

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

set -g status-bg black
set -g status-fg white

On UTF-8, many SSH clients require one to explicitly define a character set to use. For example, in Putty, select Window -> Translation -> Remote character set: UTF-8 and select Use Unicode line drawing code points.

And to turn off the status bar...

set -g status off

On colors from the manual...

message-bg colour

Set status line message background colour, where colour is one of: black, red, green, yellow, blue, magenta, cyan, white, colour0 to colour255 from the 256-colour palette, or default.

So, to list the available colors, first create a script, maybe colors.sh:

#!/usr/bin/env bash
for i in {0..255} ; do
    printf "\x1b[38;5;${i}mcolour${i}\n"
done

Next, execute the script, piping to less:

colors.sh | less -r

This produces a list of colors, 1-255, in this format:

colour1
[...]
colour255

Pick a color from the list, perhaps colour240, a shade of grey. In ~/.tmux.conf, use this value to set the desired color:

set -g status-bg colour240

In Fedora 17, 256-color terminals are not enabled by default. The official method used to enable 256-color terminals by default is given on the Fedora Project Wiki. Follow that guide, or use one of two alternate methods for one user:

  1. Set and read the TERM variable in ~/.bashrc (a new line at the end of the file)

    export TERM=screen-256color

  2. Create an alias for tmux to force 256-color support with the "-2" switch, (a new line at the end of the file)

    alias tmux="tmux -2"

After using either of these one-user solutions, log out and log in again, or simply "source" the new BASH RC file with source ~/.bashrc. Then start tmux to test it.

share|improve this answer
    
This works fine for Ubuntu, But I Fedora 17 when I set fg color to Gray it says "bad color". –  XinHua Jan 11 '13 at 22:02
    
@XinHua Updated... :) –  Christopher Jan 12 '13 at 0:19
    
I used official method from Fedora wiki, and every time I tried to login, returned this error messages: -bash: $'\r': command not found -bash: $'\r': command not found -bash: $'\r': command not found -bash: /etc/profile.d/256colors.sh: line 13: syntax error near unexpected token $'in\r'' 'bash: /etc/profile.d/256colors.sh: line 13: case "$TERM" in .Also I used the other two method, I run with no error but did not do anything! –  XinHua Jan 12 '13 at 9:04
    
@XinHua Each solution works perfectly on Fedora 17. Did you paste the script from a Mac? (The \r might be from a Mac line ending.) The solutions do not "do" anything except to enable 256 colors on Fedora 17, so that programs can use more than 8 colors. (env | grep TERM) –  Christopher Jan 12 '13 at 15:34
2  
To set bg-color to transparent: set -g status-bg default –  Mr Hyde Nov 13 '13 at 11:42

For me it's C-b, :set status-style "bg=red".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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