From 69c474427d1877ff5f559eba2e6036ea1fbdd6d4 Mon Sep 17 00:00:00 2001 From: Meutel Date: Mon, 1 May 2017 13:09:45 +0200 Subject: [PATCH] prompt local vs remote --- _bashrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/_bashrc b/_bashrc index e11f353..7cc1044 100644 --- a/_bashrc +++ b/_bashrc @@ -104,6 +104,15 @@ prompt_root() echo -n "${WHITEB}$" fi } +prompt_remote() +{ + if [ -n "$SSH_CLIENT" ] + then + echo -n "${REDB}>>" + else + echo -n "${GREENB}))" + fi +} __ps1() { @@ -111,7 +120,7 @@ __ps1() ps1post="$2" PS1="$ps1pre$ps1post" } -PS1pre='"${REDB}>> ${WHITEB}(${WHITE}\u@${GREEN}\h${WHITEB}) ${BLUEB}\w${RESET}"' +PS1pre='"$(prompt_remote) ${WHITEB}(${WHITE}\u@${GREEN}\h${WHITEB}) ${BLUEB}\w${RESET}"' PS1post='"\n$(prompt_status)$(prompt_root)${RESET} "' PROMPT_COMMAND="__ps1 $PS1pre $PS1post"