diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-06 23:55:44 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-06 23:55:44 +1200 |
commit | 1ec1671f82ec23e3288b762c847acab7cf4a8982 (patch) | |
tree | 6ccef14a54071ec58e9153044c231c9db5c40e04 /bash/bashrc.d/prompt.bash | |
parent | Safer version test (diff) | |
download | dotfiles-1ec1671f82ec23e3288b762c847acab7cf4a8982.tar.gz dotfiles-1ec1671f82ec23e3288b762c847acab7cf4a8982.zip |
Rearrange variables for tput strings
Diffstat (limited to 'bash/bashrc.d/prompt.bash')
-rw-r--r-- | bash/bashrc.d/prompt.bash | 6 |
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 |