diff options
author | Thomas Bächler <thomas@archlinux.org> | 2007-10-21 10:05:28 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2007-10-21 10:05:28 +0200 |
commit | cfab94bc71dc2e072c691122df82f4b6f2bdef29 (patch) | |
tree | 80ffd8cb7f0105c3862dfa0807466585a1fa82a9 /functions | |
parent | bb0984ad899ab3ae85ef8bf2c0e178a2b485885c (diff) |
disable colors on stupid terminals
(fixes #7369)
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -19,8 +19,21 @@ fi # we use 13 characters for our own stuff STAT_COL=$[$STAT_COL - 13] -# colors: +# disable colors on broken terminals +TERM_COLORS="$(tput colors 2>/dev/null)" +if [ -n "${TERM_COLORS}" ]; then + case "${TERM_COLORS}" in + *[!0-9]*) + USECOLOR="" + ;; + *) + [ "${TERM_COLORS}" -lt 8 ] && USECOLOR="" + ;; + esac +fi +unset TERM_COLORS +# colors: if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then C_MAIN="\033[1;37m" # main text C_OTHER="\033[1;34m" # prefix & brackets |