Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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