From edad20c5c073a524ac3d827e53b29efae662eb1b Mon Sep 17 00:00:00 2001 From: Yves Dubromelle Date: Mon, 11 Oct 2021 22:23:51 +0200 Subject: [PATCH] prompt: commentaires --- configuration/bash-prompt.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/configuration/bash-prompt.sh b/configuration/bash-prompt.sh index 90affa8..0e958f5 100644 --- a/configuration/bash-prompt.sh +++ b/configuration/bash-prompt.sh @@ -1,4 +1,4 @@ -# Définition des couleurs du prompt +# Prompt colors if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then PS1_USER='\[$(tput setaf 27)\]' PS1_HOST='\[$(tput setaf 37)\]' @@ -18,10 +18,12 @@ fi BOLD='\[$(tput bold)\]' RESET='\[$(tput sgr0)\]' -# Définition du prompt +# Username or red color if root if [ $UID = 0 ]; then PS1_ID=$PS1_ROOT else PS1_ID=$PS1_USER'\u'$PS1_MISC@$PS1_HOST fi + +# Prompt definition PS1=$RESET$BOLD$PS1_ID'\h '$PS1_PATH'\w'$PS1_GIT'$(__git_ps1)'"\n"$PS1_MISC'\$ '$RESET