From d2414a4474991347c5a4ada6d6e0989dc8a529b6 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Tue, 31 May 2016 08:48:51 +0200 Subject: [PATCH] Bash prompt w/ no color --- .config/bash/rc/prompt.bash | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.config/bash/rc/prompt.bash b/.config/bash/rc/prompt.bash index 9d4b1bf..38c2e0e 100644 --- a/.config/bash/rc/prompt.bash +++ b/.config/bash/rc/prompt.bash @@ -57,9 +57,8 @@ set_prompts() yellow="\e[1;33m" fi - fg="$white" - # build the prompt + fg="$white" # logged in as root if [[ "$USER" == "root" ]]; then @@ -78,7 +77,7 @@ set_prompts() # Set the terminal title to the current working directory. PS1="\[\033]0;\w\007\]" - if [ -n "${BASH_VERSION}" ]; then + if [[ "$TERM" == *color ]]; then PS1+=$'\r' # carriage return PS1+="\[$userStyle\]\u" # username PS1+="\[$reset$fg\] at " @@ -90,14 +89,14 @@ set_prompts() PS1+=$'\n' # newline PS1+="\[$reset$fg\]\$ \[$reset\]" # $ (and reset color) - PS2="\[${yellow}\]→ " # `→` + PS2="\[${yellow}\]→ " # `→` PS2+="\[${reset}\]" # reset color - else + else # no colors PS1+=$'\r' # carriage return PS1+="\u at \h in \w on \$(__git_ps1 %s)" PS1+=$'\n''\$ ' # newline and $ - PS2="→ " + PS2="→ " fi export PS1 PS2 -- 2.43.0