Last active
June 6, 2018 02:28
-
-
Save 2016rshah/284f83703aff6257442faac5f120a2df to your computer and use it in GitHub Desktop.
Default terminal setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom prompt | |
#--------------- | |
# Get the Git branch | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
# Make Git branch a variable | |
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
# Includes custom character for the prompt, path, and Git branch name. | |
# Source: kirsle.net/wizards/ps1.html | |
export PS1="\n\[$(tput bold)\]\[$(tput setaf 1)\]\w\[$(tput setaf 3)\]\$(parse_git_branch) \[$(tput setaf 4)\]$ \[$(tput sgr0)\]" | |
# A nice theme is the default novel theme or https://github.com/mdo/ocean-terminal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment