I already have a Monokai theme installed in Terminal, as so:
I was wondering how I could get the rest of the Monokai (as Sublime uses) into Terminal? Like, making the prompt (Gamma@~) colored, etc.
Here is my current .bash_profile file:
export PATH=/usr/local/bin:$PATH
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export PS1="\u@\w $ "
alias ls='ls -G'
Thank you very much! I know this question is rather vague, but I cannot seem to find a PS1 color scheme that matches Monokai.
Best Answer
See this answer on the Unix & Linux SE. There are a number of additional colors that can be used in a 256 color terminal.
You can view the colors in Terminal, and see their codes, by running this bash script. (There is a also a color chart in the above linked post, or IMO a more readable chart here.)
Once you determine the colors you want, and have the color codes, you can use them in a PS1 prompt like shown below.
48;5;#
where # is the color number you want, sets the background color.38;5;#
again # replaced with the color number, sets the foreground color.In my case I wanted the default background that Terminal set when it was launched, and I use
0
to note this. (You can also see that toward the end of the sequence\[\e[0m\]
- same idea, using 0 to reset everything to the default.)The below screenshot shows my original, default prompt, and then how it looks when I sourced
.bash_profile
after definingPS1
: