diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-03-21 21:20:25 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-03-21 21:20:25 -0400 |
commit | 1fbc0fab56f1a1f620d9697e8592f8f1cd023389 (patch) | |
tree | b6fa8d289b231747d36a86d963c51a4f60f59992 | |
parent | 4d458a8be62f79d7a931e7ee95da3438ca07b15e (diff) | |
download | bfs-1fbc0fab56f1a1f620d9697e8592f8f1cd023389.tar.xz |
tests: Respond to terminal resizes
-rwxr-xr-x | tests.sh | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -2079,6 +2079,13 @@ function test_L_unique_depth() { } EOL='\n' + +function update_eol() { + # Put the cursor at the last column, then write a space so the next + # character will wrap + EOL="\\033[${COLUMNS}G " +} + if [ -t 1 ]; then RED='\033[01;31m' GRN='\033[01;32m' @@ -2086,9 +2093,8 @@ if [ -t 1 ]; then RST='\033[0m' if [ ! "$VERBOSE" ]; then BOL='\r\033[K' - # Put the cursor at the last column, then write a space so the next - # character will wrap - EOL="\\033[$(tput cols)G " + update_eol + trap update_eol WINCH fi fi |