PS1 : Show git branch only when non-master.
This commit is contained in:
parent
125ef0af69
commit
f4ec896c79
|
@ -45,7 +45,9 @@ __prompt_command()
|
|||
|
||||
# Add git branch if available.
|
||||
local git_branch="$(_git_current_branch)"
|
||||
[[ "${git_branch}" = "" ]] || PS1+=" ${color_blue}@${git_branch}"
|
||||
if [[ "${git_branch}" != "" ]]; then
|
||||
[[ "${git_branch}" =~ (master|main) ]] || PS1+=" ${color_bblue}@${git_branch}"
|
||||
fi
|
||||
|
||||
# set error red
|
||||
if $is_error; then
|
||||
|
|
Reference in a new issue