From 1ec1671f82ec23e3288b762c847acab7cf4a8982 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 6 Jun 2015 23:55:44 +1200 Subject: Rearrange variables for tput strings --- bash/bashrc.d/prompt.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bash/bashrc.d/prompt.bash') 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 -- cgit v1.2.3