My command prompt

Warning: This post is over a year old. The information may be out of date.

When giving talks, I’ll often give a demo, when asking if anyone has questions at the end of the talk, often I’ll be asked “what is your prompt and where can I get it?”

The terminal application

I use iTerm2 as my terminal of choice, with the following set up (these aren’t required for the prompt, but some people have been curious):

The font I use is Hack and it’s 14pt regular, with 100% horizontal spacing and 130% vertical spacing.

Background: #131313 with around 80% opacity and a 50% blur (but this could vary greatly based on your wallpaper as that would show through)

Color Normal Bright
Black #5a5a5a #e1e1e1
Red #c65640 #df978e
Green #a7d300 #cef046
Yellow #e3c300 #ffe55f
Blue #73b2cf #9dd8f3
Magenta #c292d4 #fab0ff
Cyan #79dfd9 #79dfd9
White #ffffff #ffffff

Bash or zsh?

I use zsh, in conbination with oh-my-zsh for my terminal, I did used to have a bash version of my prompt available that looked similar to the one I use now with zsh, I’ll see if I can dig that out sometime.

So, the theme then…

My theme is custom, you can get it here: omz-brunty

The prompt looks like this:

oh-my-zsh Brunty’s Prompt

There’s a few parts to this, so I’ll annotate images and break it down a bit:

oh-my-zsh Brunty’s Prompt Annotated

On the left hand side as well, > is the start of my prompt, and before that, if the previously run command exits with a non-zero code, it’ll show like so:

oh-my-zsh Brunty’s Prompt Return code

On the right hand side is my git information:

oh-my-zsh Brunty’s Prompt Git information

The various options show me that I’m 1 commit ahead of remote (+1), as well as 1 commit behind (-1). I have new files (red dot), modified files (yellow dot) and staged files (green dot) on the feature/demo-branch branch.

It’s nice knowing there’s a couple of people using it, and liking it :)

As an update to this, I’ve posted my dotfiles on github: dotfiles