From 23978ac28a69814467a949c2757317136ccc2ae8 Mon Sep 17 00:00:00 2001 From: WANG Xuerui Date: Fri, 20 Sep 2024 20:25:16 +0800 Subject: [PATCH] make TERM=ansi in case of non-interactive calls Signed-off-by: WANG Xuerui --- scripts/_utils.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/_utils.sh b/scripts/_utils.sh index 930292a..607b841 100644 --- a/scripts/_utils.sh +++ b/scripts/_utils.sh @@ -17,6 +17,11 @@ rootfs_image_tag() { # CLI output helpers # +if [[ -z $TERM || $TERM == dumb ]]; then + TERM=ansi +fi +export TERM + declare -A _TERM_SEQ_MAP=( ["reset"]="$(tput sgr0)" ["bold"]="$(tput bold)"