Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…


Cannot retrieve contributors at this time

file 41 lines (26 sloc) 1.772 kb

Powerline style prompt for Bash

A Powerline like prompt for Bash:


  • Shows some important details about the git branch:
    • Displays the current git branch which changes background color when the branch is dirty
    • A '+' appears when untracked files are present
    • When the local branch differs from the remote, the difference in number of commits is shown along with '⇡' or '⇣' indicating whether a git push or pull is pending
  • Changes color if the last command exited with a failure code
  • If you're too deep into a directory tree, shortens the displayed path with an ellipsis
  • Shows the current Python virtualenv environment
  • It's all done in a Python script, so you could go nuts with it


  • This script uses ANSI color codes to display colors in a terminal. These are notoriously non-portable, so may not work for you out of the box, but try setting your $TERM to xterm-256color, because that works for me.

  • Patch the font you use for your terminal: see

  • Clone this repository somewhere:

    git clone
  • Create a symlink to the python script in your home:

    ln -s <path/to/> ~/

    If you don't want the symlink, just modify the path in the .bashrc command below

  • Now add the following to your .bashrc:

    function _update_ps1()
       export PS1="$(~/ $?)"
    export PROMPT_COMMAND="_update_ps1"
Something went wrong with that request. Please try again.