From 1534201101440ba422d91c7e78b99a625d9dc421 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Mon, 28 Oct 2013 12:21:16 -0500 Subject: [PATCH] Emit ANSI escape sequences directly instead of calling tput --- libexec/bats-format-tap-stream | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libexec/bats-format-tap-stream b/libexec/bats-format-tap-stream index e5e1a66..da5c88b 100755 --- a/libexec/bats-format-tap-stream +++ b/libexec/bats-format-tap-stream @@ -75,11 +75,11 @@ printf_with_truncation() { go_to_column() { local column="$1" - tput hpa "$column" + printf "\x1B[%dG" $(( $column + 1 )) } clear_to_end_of_line() { - tput el + printf "\x1B[K" } advance() { @@ -91,12 +91,11 @@ advance() { set_color() { local color="$1" local weight="$2" - tput setaf "$color" - [ -z "$weight" ] || tput "$weight" + printf "\x1B[%d;%dm" $(( 30 + $color )) "$( [ "$weight" = "bold" ] && echo 1 || echo 22 )" } clear_color() { - tput sgr0 + printf "\x1B[0m" } plural() {