Skip to content

Instantly share code, notes, and snippets.

@genyrosk
Created December 19, 2019 10:42
Show Gist options
  • Save genyrosk/0f0f847a04666c02165fe74a5d0c795f to your computer and use it in GitHub Desktop.
Save genyrosk/0f0f847a04666c02165fe74a5d0c795f to your computer and use it in GitHub Desktop.
A simple and useful prompt for bash
# add this to ~/.bashrc or ~/.bash_profile
#
# A simple and useful prompt for bash
# when zsh is not an option.
#
# - displays current directory
# - shows local git branch
# - prompt on new line
# - skips to new line after each command
#
# /-------------------------------/
# | ~/dev/project git@(master) |
# | $ ls |
# | test.py |
# | |
# | ~/dev/project git@(master) |
# | $ |
# | |
# /-------------------------------/
#
export PS1="\n \\w git@(\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \n $ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment