- if [[ $XTERM_VERSION == Cygwin* ]]; then
- get_term_color() {
- for x in "$@"; do
- case $x in
- underl) echo -n $'\E[4m' ;;
- bold) echo -n $'\E[1m' ;;
- red) echo -n $'\E[31m' ;;
- green) echo -n $'\E[32m' ;;
- blue) echo -n $'\E[34m' ;;
- cyan) echo -n $'\E[36m' ;;
- yellow) echo -n $'\E[33m' ;;
- purple) echo -n $'\E[35m' ;;
- nocolor) echo -n $'\E(B\E[m' ;;
- esac
- done
- }
+ term_underl="$(tput smul)"
+ term_bold="$(tput bold)"
+ term_red="$(tput setaf 1)"
+ term_green="$(tput setaf 2)"
+ term_blue="$(tput setaf 4)"
+ term_cyan="$(tput setaf 6)"
+ term_yellow="$(tput setaf 3)"
+ term_purple="$(tput setaf 5)"
+ term_nocolor="$(tput sgr0)" # no font attributes