prompt: commentaires

This commit is contained in:
Yves Dubromelle
2021-10-11 22:23:51 +02:00
parent ed937ba5bc
commit edad20c5c0

View File

@@ -1,4 +1,4 @@
# Définition des couleurs du prompt # Prompt colors
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
PS1_USER='\[$(tput setaf 27)\]' PS1_USER='\[$(tput setaf 27)\]'
PS1_HOST='\[$(tput setaf 37)\]' PS1_HOST='\[$(tput setaf 37)\]'
@@ -18,10 +18,12 @@ fi
BOLD='\[$(tput bold)\]' BOLD='\[$(tput bold)\]'
RESET='\[$(tput sgr0)\]' RESET='\[$(tput sgr0)\]'
# Définition du prompt # Username or red color if root
if [ $UID = 0 ]; then if [ $UID = 0 ]; then
PS1_ID=$PS1_ROOT PS1_ID=$PS1_ROOT
else else
PS1_ID=$PS1_USER'\u'$PS1_MISC@$PS1_HOST PS1_ID=$PS1_USER'\u'$PS1_MISC@$PS1_HOST
fi fi
# Prompt definition
PS1=$RESET$BOLD$PS1_ID'\h '$PS1_PATH'\w'$PS1_GIT'$(__git_ps1)'"\n"$PS1_MISC'\$ '$RESET PS1=$RESET$BOLD$PS1_ID'\h '$PS1_PATH'\w'$PS1_GIT'$(__git_ps1)'"\n"$PS1_MISC'\$ '$RESET