For platforms that does not have tput we can still perform coloring
by manually emitting the ANSI control codes. If tput is missing from
$PATH, install a replacement function.

The exact strings has been dumped from a machine that has tput, by
piping the output of tput through 'od -c -An'.

Signed-off-by: Erik Faye-Lund <>

I got slightly annoyed that we didn't get colored output from the
tests on Windows, so I decided to fix it.

Hopefully other platforms can benefit from this as well.

I'm not super happy with the condition to enable it. I considered
an environment variable as well, but decided against it because
"make -C t" from the root does not seem to pick up environment
variables configured in the main Makefile.


 t/ | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/t/ b/t/
index 78c4286..7d1b34b 100644
--- a/t/
+++ b/t/
@@ -129,6 +129,20 @@ export _x05 _x40 _z40 LF
 # This test checks if command xyzzy does the right thing...
 # '
 # . ./
+if ! which tput > /dev/null ; then
+       tput () {
+               case "$1" in
+               bold)
+                       echo -ne "\033[1m" ;;
+               setaf)
+                       echo -ne "\033[0;3$2m" ;;
+               sgr0)
+                       echo -ne "\033(\033[m" ;;
+               esac
+       }
 [ "x$ORIGINAL_TERM" != "xdumb" ] && (
                TERM=$ORIGINAL_TERM &&
                export TERM &&

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to