;imp: hledger-bar: disable ANSI if terminal is non-interactive

This commit is contained in:
Simon Michael 2023-05-06 16:25:51 -10:00
parent 515e8622a2
commit c5b2465fb0

View File

@ -76,7 +76,7 @@ poschar="+"
# utils
# https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit and 24-bit colors:
if [[ -v $NO_COLOR ]]; then
if [[ $- != *i* || -v $NO_COLOR ]]; then
red=''
green=''
nocol=''