updated stuffs

This commit is contained in:
Nikolas Weger 2019-11-07 23:20:34 +01:00
parent aad676ae04
commit 4bdb65b4b8
14 changed files with 127 additions and 39 deletions

View file

@ -427,6 +427,13 @@ ansi::invisible() {
}
ansi::isAnsiSupported() {
# Optionally override detection logic
# to support post processors that interpret color codes _after_ output is generated.
# Use environment variable "ANSI_FORCE_SUPPORT=<anything>" to enable the override.
if [[ -n "${ANSI_FORCE_SUPPORT-}" ]]; then
return 0
fi
if hash tput &> /dev/null; then
if [[ "$(tput colors)" -lt 8 ]]; then
return 1
@ -1513,6 +1520,12 @@ ansi() {
m65="65;"
;;
--ideogram-stress)
$supported && ansi::ideogramStress
restoreText=true
m65="65;"
;;
--reset-ideogram)
$supported && ansi::noIdeogram
;;
@ -1603,7 +1616,7 @@ ansi() {
fi
if $restoreText; then
m="$m10$m22$m23$m24$m25$m27$m28$m29$m$m39$m49$m54$m55$m65"
m="$m10$m22$m23$m24$m25$m27$m28$m29$m39$m49$m54$m55$m65"
printf '%s%sm' "$ANSI_CSI" "${m%;}"
fi
fi