Last active
March 22, 2026 22:49
-
-
Save keegoid/b4b5e771b93b707b8a07ad48c33ba761 to your computer and use it in GitHub Desktop.
.bash_prompt
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Load git prompt | |
| if [[ -r "/opt/homebrew/opt/git/etc/bash_completion.d/git-prompt.sh" ]]; then | |
| . /opt/homebrew/opt/git/etc/bash_completion.d/git-prompt.sh | |
| elif [[ -r "/usr/local/etc/bash_completion.d/git-prompt.sh" ]]; then | |
| . /usr/local/etc/bash_completion.d/git-prompt.sh | |
| fi | |
| function virtualenv_info() { | |
| [[ -n "$VIRTUAL_ENV" ]] && echo "($(basename "$VIRTUAL_ENV"))" | |
| } | |
| # Git prompt settings | |
| export GIT_PS1_SHOWDIRTYSTATE=1 | |
| export GIT_PS1_SHOWSTASHSTATE=1 | |
| export GIT_PS1_SHOWUPSTREAM="verbose" | |
| export GIT_PS1_SHOWCOLORHINTS=1 | |
| export GIT_PS1_HIDE_IF_PWD_IGNORED=1 | |
| export VIRTUAL_ENV_DISABLE_PROMPT=1 | |
| export PROMPT_DIRTRIM=1 | |
| # PS1 with line-wrapping) | |
| export PS1='\[\033[38;5;245m\]┌─\[\033[38;5;74m\]\u@\h \[\033[0;33m\]\! \[\033[1;31m\]\w\[\033[0m\]$(__git_ps1 " (\[\033[38;5;35m\]%s\[\033[0m\])")\n\[\033[38;5;245m\]└──\[\033[1;33m\]$(virtualenv_info)\[\033[0m\]\$ ' | |
| # Remove the PROMPT_COMMAND entirely to keep things simple | |
| unset PROMPT_COMMAND |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment