Skip to content

Instantly share code, notes, and snippets.

@claytantor
Last active April 21, 2019 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claytantor/cf525ffe375e8fabae7d40260f11ff4e to your computer and use it in GitHub Desktop.
Save claytantor/cf525ffe375e8fabae7d40260f11ff4e to your computer and use it in GitHub Desktop.
update_PS1 () {
VENV_PROMPT="(${VIRTUAL_ENV##*/})"
if [ $VENV_PROMPT == "()" ]; then
VENV_PROMPT=""
fi
PS1="\[$(tput bold)\]\[\033[38;5;214m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;76m\]@\[$(tput sgr0)\]\[\033[38;5;82m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;226m\]\W\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]"
PS1="$PS1$(__git_ps1 "\[\e[32m\][%s]\[\e[0m\]") $VENV_PROMPT $ "
}
shopt -u promptvars
PROMPT_COMMAND=update_PS1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment