]> Sergey Matveev's repositories - bfs.git/commitdiff
tests: Fix column detection with redirected stderr
authorTavian Barnes <tavianator@tavianator.com>
Fri, 20 Oct 2023 19:56:55 +0000 (15:56 -0400)
committerTavian Barnes <tavianator@tavianator.com>
Fri, 20 Oct 2023 19:56:55 +0000 (15:56 -0400)
tests/run.sh

index 5fcccad34db7f0a64e7367486c0a12c64165aa71..7b7fe246fbb7b369ba75b93ae71697965b137e62 100644 (file)
@@ -14,7 +14,7 @@ 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)
+        cols=$(tput cols 2>/dev/tty)
     fi
 
     # Put the cursor at the last column, then write a space so the next