Ps1 : Fix color braces.

This commit is contained in:
Dmitry Voronin 2024-02-10 04:26:57 +03:00
parent 7fe72384b5
commit 54d3c95eb0

View file

@ -46,7 +46,7 @@ function __prompt_command() {
if ! _git_is_dotfiles; then
local git_branch="$(_git_current_branch)"
if [[ "${git_branch}" != "" ]]; then
PS1+=" ${color_bblue}@${git_branch}"
PS1+=" \[${color_bblue}\]@${git_branch}"
fi
fi
@ -61,11 +61,11 @@ function __prompt_command() {
# If error, show code.
if ${is_error}; then
PS1+="${color_red}("
PS1+="\[${color_red}\]("
PS1+="${last_status}"
local error_type="$(_ps1error ${last_status})"
[[ "${error_type}" != "" ]] && PS1+=" ${error_type}"
PS1+=")${color_default} "
PS1+=")\[${color_default}\] "
fi
# command on new line
@ -74,7 +74,7 @@ function __prompt_command() {
# Show nix shell name.
if [ -n "${NIX_SHELL}" ]; then
PS1+="${color_white}${NIX_SHELL}${color_default} "
PS1+="\[${color_white}\]${NIX_SHELL}\[${color_default}\] "
fi
# Show remote connections.