Merge pull request #2216 from forslund/bugfix/no-color-term

Check for terminals ability to display colours
pull/2224/head
Åke 2019-07-19 11:33:42 +02:00 committed by GitHub
commit 95927fbfd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -115,13 +115,16 @@ function get_YN() {
done
}
# If tput is available and can handle multiple colors
if found_exe tput ; then
GREEN=$(tput setaf 2)
BLUE=$(tput setaf 4)
CYAN=$(tput setaf 6)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
HIGHLIGHT=$YELLOW
if [[ $(tput colors) != "-1" ]]; then
GREEN=$(tput setaf 2)
BLUE=$(tput setaf 4)
CYAN=$(tput setaf 6)
YELLOW=$(tput setaf 3)
RESET=$(tput sgr0)
HIGHLIGHT=$YELLOW
fi
fi
# Run a setup wizard the very first time that guides the user through some decisions