Skip to content

Commit

Permalink
Merge pull request #2216 from forslund/bugfix/no-color-term
Browse files Browse the repository at this point in the history
Check for terminals ability to display colours
  • Loading branch information
forslund committed Jul 19, 2019
2 parents 160a06f + 3100c72 commit 95927fb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions dev_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95927fb

Please sign in to comment.