128

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

0

5 Answers 5

154

There are many options given in the manual. (See the OPTIONS section.) Create an RC file: ~/.tmux.conf. The content 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

In FreeBSD 10.1, I had to add -g to the UTF directives.

set -g status-utf8 on
set -g utf8 on

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.

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;%smcolour%s\n" "${i}" "${i}"
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, as a per-user solution, create an alias for tmux to force 256-color support with the "-2" switch.

alias tmux="tmux -2"

Then start tmux to test it.

Note that, as @ILMostro_7 points out, it would not be correct to set the TERM type for tmux from, for example, ~/.bashrc. Each tmux pane emulates a terminal - not the same thing as an xterm. The emulation in tmux needs to match "screen," a different terminal description, to behave properly; but, the real terminal does not need to do so. Its description is xterm-256color.

8
  • This works fine for Ubuntu, But I Fedora 17 when I set fg color to Gray it says "bad color".
    – Sam
    Commented Jan 11, 2013 at 22:02
  • 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!
    – Sam
    Commented Jan 12, 2013 at 9:04
  • 5
    To set bg-color to transparent: set -g status-bg default
    – Mr Hyde
    Commented Nov 13, 2013 at 11:42
  • 1
    Here's the color map: github.com/guns/xterm-color-table.vim/blob/master/… Example: color260 is orange. In Tmux, hit Control-b, then :set -g status-bg colour260. (Tmux uses international "colour" vs American "color.") Also note that Tmux has history, to update the color do Control-b, then : to enter command mode, and hit up arrow to edit the last set color command. Commented Feb 9, 2016 at 19:04
  • might be a better solution to use xterm-256color instead of screen-256color for the TERM environment variable.
    – ILMostro_7
    Commented Apr 4, 2016 at 7:34
44

For me it's

  • Ctrl+B
  • then enter
    :set status-style "bg=red"
    
2
  • This solution worked for me on my mac with os 10.10.5 Commented Mar 21, 2016 at 16:22
  • @ReinaAbolofia Great! =D Commented Apr 19, 2016 at 15:09
10

You can make the status bar transparent. Put this into your ~/.tmux.conf.

set -g status-style bg=default

enter image description here

enter image description here

1
  • 1
    Works on macOS. Also the cleanest / simplest of the available solution. And looks good too.
    – NNNComplex
    Commented Aug 22, 2022 at 13:59
1

If you are changing status-style and it is not applying, take a look at other places in your config, as you might be overriding it somehow.

I had status-left and status-right with custom fg colors, so status-style fg wouldn't apply. Took me a while to find out.

1

True Color / 24bit supported in tmux

It's worth noting that tmux supports RGB colors as well as the xterm 256 and 16 color palettes.

(Added in Tmux v3.1 / Feb 2020)

So when setting status-bg, etc. we can use a hex color:

Ctrl+b

:set status-bg "#003366"

For example to set the default status bar background to a turquoise color.

IMPORTANT the terminal emulator in use ultimately determines color support, so check the terminal docs when in doubt. In 2024 most do, notably Macos Terminal.app does not. (XTerm does, libvte based terms do, iTerm does... etc.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .