aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-21 15:18:05 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-21 15:18:05 +1200
commit988ed86f71f63fb9c12a602771c70419510120f5 (patch)
tree4e25826775575e07b83359a7340e4656aa938940
parent517ea8e2a33d4b991cea66e76b860bf94979bc78 (diff)
downloaddotfiles-988ed86f71f63fb9c12a602771c70419510120f5.tar.gz
dotfiles-988ed86f71f63fb9c12a602771c70419510120f5.zip
Target terminfo first, then termcap
-rw-r--r--bash/bashrc.d/prompt.bash18
1 files changed, 9 insertions, 9 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index c15c9c97..a3f32235 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -38,13 +38,13 @@ prompt() {
# Count available colors
local -i colors
colors=$( {
- tput Co || tput colors
+ tput colors || tput Co
} 2>/dev/null )
# Prepare reset code
local reset
reset=$( {
- tput me || tput sgr0
+ tput sgr0 || tput me
} 2>/dev/null )
# Decide prompt color formatting based on color availability
@@ -55,10 +55,10 @@ prompt() {
256)
format=$( {
: "${PROMPT_COLOR:=10}"
- tput AF "$PROMPT_COLOR" ||
tput setaf "$PROMPT_COLOR" ||
- tput AF "$PROMPT_COLOR" 0 0 ||
- tput setaf "$PROMPT_COLOR" 0 0
+ tput setaf "$PROMPT_COLOR" 0 0 ||
+ tput AF "$PROMPT_COLOR" ||
+ tput AF "$PROMPT_COLOR" 0 0
} 2>/dev/null )
;;
@@ -66,9 +66,9 @@ prompt() {
8)
format=$( {
: "${PROMPT_COLOR:=2}"
- tput AF "$PROMPT_COLOR" ||
- tput setaf "$PROMPT_COLOR"
- tput md || tput bold
+ tput setaf "$PROMPT_COLOR" ||
+ tput AF "$PROMPT_COLOR"
+ tput bold || tput md
} 2>/dev/null )
;;
@@ -76,7 +76,7 @@ prompt() {
# use bold
*)
format=$( {
- tput md || tput bold
+ tput bold || tput md
} 2>/dev/null )
;;
esac