1

I already have a Monokai theme installed in Terminal, as so:

enter image description here

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.

0

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.)

#!/bin/bash

color=16;

while [ $color -lt 245 ]; do
    echo -e "$color: \\033[38;5;${color}mhello\\033[48;5;${color}mworld\\033[0m"
    ((color++));
done

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.)

export PS1='\[\e[0;38;5;166m\]\u@\H\[\e[0m\] \w $ '

The below screenshot shows my original, default prompt, and then how it looks when I sourced .bash_profile after defining PS1:

enter image description here

| improve this answer | |
  • I've started using iTerm2 and zsh, but this is still relevant. Thanks! – CodeSammich May 22 '16 at 5:29
0

Not a direct answer to your question, but have you looked at iTerm? It comes with several additional features on top of Terminal, and you can download and install a whole bunch of sweet themes on top of it. Apart from iTerm, I can also recommend zsh, which is just an additional layer on top of the bash shell, and if you use the oh-my-zsh plugin, again, you get a whole bunch of pre-cooked themes and prompts.

| improve this answer | |

You must log in to answer this question.

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