Call tput with one capcode per command line. The use of multiple
capcodes is not portable in practice [1]. For example, it is not
supported by the version currently shipped with macOS.

Also, use capcodes that match what the original printf produced.

[1] ncurses added the feature in patch 20210925, noting:
    Portable applications should not rely upon this feature; ncurses
    offers it to support applications written specifically for OpenBSD.
---
 tests/RUN-ONE-TEST    | 3 ++-
 tests/RUN-TEST-SCRIPT | 3 ++-
 tests/run-all         | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST
index f3a23b8f..422da819 100755
--- a/tests/RUN-ONE-TEST
+++ b/tests/RUN-ONE-TEST
@@ -12,7 +12,8 @@ rm -f ${BASH_TSTOUT}
 
 if [ -t 1 ]; then
        if type -P tput >/dev/null; then
-               CSTART=$(tput setaf 15 setab 1) CEND=$(tput sgr0)
+               CSTART=$(tput bold; tput setab 9; tput setaf 7)
+               CEND=$(tput sgr0)
        else
                # can't rely on having $'...' or printf understanding \e
                # bright red background, white foreground text
diff --git a/tests/RUN-TEST-SCRIPT b/tests/RUN-TEST-SCRIPT
index fec43b2d..55879d1c 100755
--- a/tests/RUN-TEST-SCRIPT
+++ b/tests/RUN-TEST-SCRIPT
@@ -12,7 +12,8 @@ rm -f ${BASH_TSTOUT}
 
 if [ -t 1 ]; then
        if type -P tput >/dev/null; then
-               CSTART=$(tput setaf 15 setab 1) CEND=$(tput sgr0)
+               CSTART=$(tput bold; tput setab 9; tput setaf 7)
+               CEND=$(tput sgr0)
        else
                # can't rely on having $'...' or printf understanding \e
                # bright red background, white foreground text
diff --git a/tests/run-all b/tests/run-all
index cf795478..ac3893ec 100644
--- a/tests/run-all
+++ b/tests/run-all
@@ -63,7 +63,8 @@ echo Any output from any test, unless otherwise noted, 
indicates a possible anom
 # keep track of passed and failed tests and report them
 if [ -t 1 ]; then
        if type -P tput >/dev/null; then
-               CSTART=$(tput setaf 15 setab 1) CEND=$(tput sgr0)
+               CSTART=$(tput bold; tput setab 9; tput setaf 7)
+               CEND=$(tput sgr0)
        else
                # can't rely on having $'...' or printf understanding \e
                # bright red background, white foreground text
-- 
2.52.0


Reply via email to