Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 got my git branch color set by this tutorial:http://www.bramschoenmakers.nl/en/node/624

But recenlty I've reverted my terminal background color, and the yellow branch name is nearly invisible under grey background. So I need to change this config:

export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '

The problem is, I can't discern which part determines the color in the above code, thus I ask for help here.

share|improve this question
See the Arch Wiki page on color bash prompts... – jasonwryan Aug 30 '14 at 5:48
up vote 2 down vote accepted

This is a color definition:






share|improve this answer
Is this RGB? what rules does this follow? – Zen Aug 30 '14 at 5:52
Nope, the colors come from the following list: Black 0;30 Dark Gray 1;30 Blue 0;34 Light Blue 1;34 Green 0;32 Light Green 1;32 Cyan 0;36 Light Cyan 1;36 Red 0;31 Light Red 1;31 Purple 0;35 Light Purple 1;35 Brown 0;33 Yellow 1;33 Light Gray 0;37 White 1;37 – Scyld de Fraud Aug 30 '14 at 5:54
Wonderful, I love this world – Zen Aug 30 '14 at 5:58
Isn't 44;1;31m setting both foreground and background? – Jim Davis Aug 31 '14 at 6:42

Those colors are determined by terminal control codes. For a near-complete reference have a look at the XTerm Control Sequences, most terminal emulators nowadays are mostly compatible to XTerm.

share|improve this answer

Your Answer


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.