From 54d3c95eb01caec7e7cf68ab0cfcff2c36f29c19 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Sat, 10 Feb 2024 04:26:57 +0300 Subject: [PATCH] Ps1 : Fix color braces. --- .config/bash/module/Ps1.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/bash/module/Ps1.sh b/.config/bash/module/Ps1.sh index e9ce6cb..d8c26da 100644 --- a/.config/bash/module/Ps1.sh +++ b/.config/bash/module/Ps1.sh @@ -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.