Last active
July 3, 2025 06:23
-
-
Save richardleandro1/697dbf73a0a8417764f9d6dd56227a47 to your computer and use it in GitHub Desktop.
zsh branch
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
# > GIT BRANCH TERMINAL | |
function parse_git_branch() { | |
local branch | |
branch=$(git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/\1/p') | |
[[ -n $branch ]] && echo "[$branch]" | |
} | |
# blink on/off | |
BLINK_ON=$'%{\e[5m%}' | |
BLINK_OFF=$'%{\e[0m%}' | |
# cores | |
COLOR_USR=$'%F{243}' | |
COLOR_DIR=$'%F{197}' | |
COLOR_GIT_FG=$'%F{39}' | |
COLOR_DEF=$'%f%k' | |
setopt PROMPT_SUBST | |
export PROMPT="${COLOR_USR}%n ${COLOR_DIR}%~ ${COLOR_GIT_FG}${BLINK_ON}\$(parse_git_branch)${BLINK_OFF}${COLOR_DEF} $ " | |
# > END GIT TERMINAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment