aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2015-06-06 23:55:44 +1200
committerTom Ryder <tom@sanctum.geek.nz>2015-06-06 23:55:44 +1200
commit1ec1671f82ec23e3288b762c847acab7cf4a8982 (patch)
tree6ccef14a54071ec58e9153044c231c9db5c40e04 /bash/bashrc.d
parentSafer version test (diff)
downloaddotfiles-1ec1671f82ec23e3288b762c847acab7cf4a8982.tar.gz
dotfiles-1ec1671f82ec23e3288b762c847acab7cf4a8982.zip
Rearrange variables for tput strings
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash6
1 files changed, 4 insertions, 2 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 94e49ff2..6d38c4d3 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -21,18 +21,20 @@ prompt() {
PROMPT_DIRTRIM=4
fi
- # Count available colors, reset, and format (decided shortly)
+ # Count available colors
local -i colors
colors=$( {
tput Co || tput colors
} 2>/dev/null )
+
+ # Prepare reset code
local reset
reset=$( {
tput me || tput sgr0
} 2>/dev/null )
- local format
# Decide prompt color formatting based on color availability
+ local format
case $colors in
# Check if we have non-bold bright green available