Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set something to gray, but can't figure out how. The only bit of info in the man page about colors I can find is:

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.

I also found a blog post which iterates through colors, but I can't quite grok it, and don't want to sit at the terminal all day guessing color numbers until one works.

share|improve this question
up vote 130 down vote accepted

You can get a list with this bash script:

for i in {0..255} ; do
    printf "\x1b[38;5;${i}mcolour${i}\n"

Then use colourxxx with tmux.

share|improve this answer
use $ reset to get your prompt color back :> – lkraav Feb 14 '12 at 10:26
perhaps you need three digit colours? This script outputs like color12 but that is not accepted by tmux as a valid colour. – artfulrobot Jan 11 '13 at 11:49
My tmux (1.6) accepts even colors like colour12 (mind the "u"). – cYrus Jan 11 '13 at 12:28
This answer is still helpful! Helped me pick the colors I wanted. – asfallows Oct 18 '13 at 20:48
omg! A rainbow on my terminal. Just in time to celebrate marriage equality in the US! – garbelini Jun 29 '15 at 14:11

In Subversion (what will be tmux 1.5) you can also use #abcdef hex-style colours which are mapped to the nearest 256 colour palette entry. You need quotes as it's treated as a string, whereas regular color names are treated as named constants. Also note that 3-letter shorthand (#f00) is invalid.


set pane-active-border-bg red # no quotes for name
set pane-active-border-bg "#ff0000" # quotes for rgb
share|improve this answer
Can you? I can't see how to... – Eric Apr 23 '12 at 18:18
set-option message-bg "#abcdef"; the quotes are necessary. – chepner May 1 '12 at 20:05
You also seem to have to use the full 6 hex chars, no 3 char shortcuts i.e. #fff will not work, you have to use #ffffff – bschlueter Dec 9 '15 at 21:44

tmux through 1.9 only supports the international spelling for the 256 colour palette, e.g.


as opposed to the American spelling that drops the u


Looks like this will be changed soon,

share|improve this answer

I've been using the xterm-color-table.vim script. Any 256 color terminal color table will work.

share|improve this answer

Building up on @cYrus' answer, I wrote a script to break the output of the colors into N number of columns, where N is the first argument


if [ -z $1 ]; then
for i in {0..255} ; do
    printf "\x1b[38;5;${i}mcolour${i} \t"
    if [ $(( i % $BREAK )) -eq $(($BREAK-1)) ] ; then
        printf "\n"

Try it by saving it into a file called, then ./ 4

Don't forget to chmod +x first.

share|improve this answer

I found this image to be enlightening.

enter image description here

share|improve this answer

You must log in to answer this question.

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