From 1798d6f536cd8ec8557aabb6c65fc57dcea4546e Mon Sep 17 00:00:00 2001 From: Grigory Shipunov Date: Thu, 2 Dec 2021 13:44:46 +0100 Subject: [PATCH] highlight host if connected over ssh --- bash/.bashrc.d/prompt.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash/.bashrc.d/prompt.sh b/bash/.bashrc.d/prompt.sh index a13a30c..0571595 100644 --- a/bash/.bashrc.d/prompt.sh +++ b/bash/.bashrc.d/prompt.sh @@ -1 +1,5 @@ -export PS1="\[\e[1;36m\]\u@\h\[\e[1;0m\]:\[\e[1;92m\]\w\[\e[1;0m\]$ " +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + export PS1="\[\e[1;36m\]\u@\[\e[1;35m\]\h\[\e[1;0m\]:\[\e[1;92m\]\w\[\e[1;0m\]$ " +else + export PS1="\[\e[1;36m\]\u@\h\[\e[1;0m\]:\[\e[1;92m\]\w\[\e[1;0m\]$ " +fi