Last active
July 18, 2024 03:12
-
-
Save mshafeeqkn/794d26711a7201552354493c7a2e77ee to your computer and use it in GitHub Desktop.
The PS1 variable for bashrc
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
parse_git_branch() { | |
_branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/') | |
_branch="$_branch" | |
echo $_branch | |
} | |
export PS1="\[\033[38;5;42m\]\u@\h\[\033[00m\]:\[\033[38;5;39m\]\W\[\033[38;5;198m\]\$(parse_git_branch)\[\033[00m\]$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment