We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9693c99 commit 4d8a085Copy full SHA for 4d8a085
slib.sh
@@ -61,10 +61,18 @@ fi
61
# canonical source http://github.com/swelljoe/scolors
62
63
# Check if terminal is supported and set TERM to a supported one if not
64
-is_term_supported() {
+is_term_supported () {
65
term=$1
66
[ -n "$term" ] || term=dumb # avoid empty TERM
67
- tput -T "$term" cols >/dev/null 2>&1 # any capability is enough
+ # Tput probe
68
+ if command -pv tput >/dev/null 2>&1; then
69
+ tput -T "$term" cols >/dev/null 2>&1 && return 0 || return 1
70
+ fi
71
+ # Infocmp probe
72
+ if command -pv infocmp >/dev/null 2>&1; then
73
+ infocmp "$term" >/dev/null 2>&1 && return 0 || return 1
74
75
+ return 1
76
}
77
FALLBACK_TERMS='xterm-256color xterm-color xterm vt220 ansi dumb'
78
if ! is_term_supported "$TERM"; then
0 commit comments