diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-21 17:10:27 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-21 17:10:27 +1300 |
commit | 17afda4f227fbb8c07269ef8c96cc7931cf6f02f (patch) | |
tree | 294adcfbb64d61e41b2a7df1ba33052e71513f6d /ksh/kshrc.d | |
parent | Correct shell breakdown (diff) | |
download | dotfiles-17afda4f227fbb8c07269ef8c96cc7931cf6f02f.tar.gz dotfiles-17afda4f227fbb8c07269ef8c96cc7931cf6f02f.zip |
Use clearer logic for prompt color setting
Diffstat (limited to 'ksh/kshrc.d')
-rw-r--r-- | ksh/kshrc.d/prompt.ksh | 15 |
1 files changed, 7 insertions, 8 deletions
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 ) |