diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/tests.sh | 8 |
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 |