Skip to content

Commit

Permalink
UNIX shell script testing - Fix missing presence of $TERM environment…
Browse files Browse the repository at this point in the history
… variable.

Set default TERM to xterm-basic
  • Loading branch information
noresources committed Oct 31, 2024
1 parent 9249c45 commit 2f2e2fb
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tools/sh/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1395,13 +1395,10 @@ NORMAL_COLOR==''
ERROR_COLOR=''
SUCCESS_COLOR=''

if [ ! -z "${TERM}" ]
then
# http://stackoverflow.com/questions/4332478/read-the-current-text-color-in-a-xterm/4332530#4332530
NORMAL_COLOR="$(tput sgr0)"
ERROR_COLOR="$(tput setaf 1)"
SUCCESS_COLOR="$(tput setaf 2)"
fi
# http://stackoverflow.com/questions/4332478/read-the-current-text-color-in-a-xterm/4332530#4332530
NORMAL_COLOR="$(tput -Txterm-basic sgr0)"
ERROR_COLOR="$(tput -Txterm-basic setaf 1)"
SUCCESS_COLOR="$(tput -Txterm-basic setaf 2)"

log()
{
Expand Down

0 comments on commit 2f2e2fb

Please sign in to comment.