prompt: commentaires

nixos-21.05-preparation
Yves Dubromelle 4 years ago
parent ed937ba5bc
commit edad20c5c0

@ -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

Loading…
Cancel
Save