Detect ssh in bashrc

This commit is contained in:
Thomas Forgione 2019-05-03 11:16:17 +02:00
parent 16b62a92a3
commit 2f3a390f5a
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 7 additions and 2 deletions

9
bashrc
View File

@ -57,11 +57,16 @@ if [ -n "$force_color_prompt" ]; then
fi
if [ "$color_prompt" = yes ]; then
PS1="\033[1;35m╭── \u\033[33m::\033[34m\w\033[0m\n\033[35m╰▶ \033[0m"
if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH2_CLIENT" ]]; then
color="\033[1;35m"
else
color="\033[1;32m"
fi
PS1="${color}╭── \u\033[33m::\033[34m\w\033[0m\n${color}╰▶ \033[0m"
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
unset color_prompt force_color_prompt color
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then