Right now my iTerm2 looks like this...

enter image description here

Everything is the same color and is hard to read. Can I make any of the Prompt, Command, and Output different colors like this?

enter image description here


There's a pretty exhaustive description of editing the bash prompt here there might be some linux specific stuff, but most of it is generic bash stuff.

But just for getting started, I recommend this bash profile generator

It is pretty simple, so I've since learned more and my prompt looks like: dwightk's bash prompt


[[ -s "/Users/dwightk/.rvm/scripts/rvm" ]] && source "/Users/dwightk/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
export PS1="🍔  \[\033[01;35m\]\u@\h:\[\033[01;34m\]\$(parse_git_branch) \[\033[01;32m\]\w \[\033[01;34m\]\n>\[\e[0m\]"

which is pretty useful when dealing with git. Everything before the export PS1= is what enables the git branch to appear.

The 🍔 is from my first foray into bash prompt editing after I read this blog post.


AFAIK there is no any UNIXy way to color anything else than the prompt.

But as you asked for an iTerm2 solution you are in luck! Use the Triggers feature to color text matching regexp.

For example if your prompts looks like this:

..then add in iTerm -> Preferences -> Profiles -> Advanced -> Triggers , [Edit] a Trigger like this:

..that will match the command part of each line, which will start to look like this:

Voilà - you have different colors for prompt, command and output! :)

  • This is simpler for most folks I bet so upvoted. But since the other one will work in any term, even remotely and it colors the git prompt as well, I'm going to keep it as the accepted answer. – jeremyjjbrown Sep 8 '16 at 20:06
  • What font do you use? – towry Sep 25 '16 at 1:33
  • @towry : Consolas – Greg Dubicki Sep 25 '16 at 10:01

Here's what worked for me. Try it and let me know.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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