[bash] use red prompt when logged in as root
This commit is contained in:
parent
bdc0179c6d
commit
03bc9ce933
1 changed files with 7 additions and 1 deletions
8
bashrc
8
bashrc
|
@ -135,7 +135,13 @@ do_solarize_shell() {
|
|||
fi
|
||||
|
||||
# Customize the prompt
|
||||
[ -n "$SSH_CLIENT" ] && __c="0;33" || __c="0;36"
|
||||
if [ $(id -u) -eq 0 ]; then
|
||||
__c="1;31" # orange user name for root
|
||||
elif [ -n "$SSH_CLIENT" ]; then
|
||||
__c="0;33" # yellow user name when connected via SSH
|
||||
else
|
||||
__c="0;36" # default user name color is cyan
|
||||
fi
|
||||
export PS1="\n[\[\033[${__c}m\]\u@\h \[\033[0;34m\]\w\[\033[0m\]]\n\$ "
|
||||
export PS2=". "
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue