summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-09 22:07:28 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-09 22:07:28 -0400
commitb39509d52d84ff52617dd9d3240b59cb3d8ca2d4 (patch)
tree21fde349e84ebb7871440aa6492acd72c0aa6103
parent820735a85dbc2c9d19e948ea37945306ed7bc997 (diff)
downloadbfs-b39509d52d84ff52617dd9d3240b59cb3d8ca2d4.tar.xz
tests: Work around Bash 4 not updating $COLUMNS
-rwxr-xr-xtests.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests.sh b/tests.sh
index 93ac03c..9e2f830 100755
--- a/tests.sh
+++ b/tests.sh
@@ -2311,6 +2311,13 @@ function update_eol() {
if [ -t 1 -a ! "$VERBOSE" ]; then
BOL='\r\033[K'
+
+ # Workaround for bash 4: checkwinsize is off by default. We can turn it on,
+ # but we also have to explicitly trigger a foreground job to finish so that
+ # it will update the window size before we use $COLUMNS
+ shopt -s checkwinsize
+ (:)
+
update_eol
trap update_eol WINCH
fi