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 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
2  
See the Arch Wiki page on color bash prompts... –  jasonwryan Aug 30 at 5:48

2 Answers 2

up vote 2 down vote accepted

This is a color definition:

Foreground

\[\033[1;30m\]

Background

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

Cheers,

share|improve this answer
    
Is this RGB? what rules does this follow? –  Zen Aug 30 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 at 5:54
    
Wonderful, I love this world –  Zen Aug 30 at 5:58
    
Isn't 44;1;31m setting both foreground and background? –  Jim Davis Aug 31 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

 
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.