1

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.

2

This is a color definition:

Foreground

\[\033[1;30m\]

Background

\[\033[44;1;31m\]

Cheers,

  • Is this RGB? what rules does this follow? – Zen Aug 30 '14 at 5:52
  • 2
    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
4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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