From 2f3a390f5a91789ed88d2f909133390269e02cee Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 3 May 2019 11:16:17 +0200 Subject: [PATCH] Detect ssh in bashrc --- bashrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index a0af691..34a6e16 100644 --- a/bashrc +++ b/bashrc @@ -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