aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc.d/prompt.bash15
-rw-r--r--ksh/kshrc.d/prompt.ksh15
2 files changed, 14 insertions, 16 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index ed09afdd..776ac8a6 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -52,19 +52,18 @@ prompt() {
# Check if we have non-bold bright green available
if ((colors >= 16)) ; then
format=$(
- : "${PROMPT_COLOR:=10}"
- tput setaf "$PROMPT_COLOR" ||
- tput setaf "$PROMPT_COLOR" 0 0 ||
- tput AF "$PROMPT_COLOR" ||
- tput AF "$PROMPT_COLOR" 0 0
+ pc=${PROMPT_COLOR:-10}
+ tput setaf "$pc" ||
+ tput setaf "$pc" 0 0 ||
+ tput AF "$pc" ||
+ tput AF "$pc" 0 0
)
# If we have only eight colors, use bold green
elif ((colors >= 8)) ; then
format=$(
- : "${PROMPT_COLOR:=2}"
- tput setaf "$PROMPT_COLOR" ||
- tput AF "$PROMPT_COLOR"
+ pc=${PROMPT_COLOR:-2}
+ tput setaf "$pc" || tput AF "$pc"
tput bold || tput md
)
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index 2ebe1099..fe1f0273 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -58,19 +58,18 @@ function prompt {
# Check if we have non-bold bright yellow available
if ((colors >= 16)) ; then
format=$(
- : "${PROMPT_COLOR:=11}"
- tput setaf "$PROMPT_COLOR" ||
- tput setaf "$PROMPT_COLOR" 0 0 ||
- tput AF "$PROMPT_COLOR" ||
- tput AF "$PROMPT_COLOR" 0 0
+ pc=${PROMPT_COLOR:-11}
+ tput setaf "$pc" ||
+ tput setaf "$pc" 0 0 ||
+ tput AF "$pc" ||
+ tput AF "$pc" 0 0
)
# If we have only eight colors, use bold yellow
elif ((colors >= 8)) ; then
format=$(
- : "${PROMPT_COLOR:=3}"
- tput setaf "$PROMPT_COLOR" ||
- tput AF "$PROMPT_COLOR"
+ pc=${PROMPT_COLOR:-3}
+ tput setaf "$pc" || tput AF "$pc"
tput bold || tput md
)