summaryrefslogtreecommitdiffstats
path: root/tests/tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests.sh')
-rwxr-xr-xtests/tests.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 639822a..3fdf49b 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -630,9 +630,15 @@ BOL='\n'
EOL='\n'
function update_eol() {
+ # Bash gets $COLUMNS from stderr, so if it's redirected use tput instead
+ local cols="${COLUMNS-}"
+ if [ -z "$cols" ]; then
+ cols=$(tput cols)
+ fi
+
# Put the cursor at the last column, then write a space so the next
# character will wrap
- EOL="\\033[${COLUMNS}G "
+ EOL="\\033[${cols}G "
}
if [ "$VERBOSE_TESTS" ]; then