summaryrefslogtreecommitdiffstats
path: root/tests/util.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-05-22 16:12:37 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-05-22 16:12:37 -0400
commit59b1c525c4c7c254dce702fca0fa472616a976d2 (patch)
tree6df8b88d03b541d2eea43184ec98fd4c625b70fa /tests/util.sh
parent98191107e1dd2d186604bdb58990e020fc04c24e (diff)
downloadbfs-59b1c525c4c7c254dce702fca0fa472616a976d2.tar.xz
tests: Print progress outside the scroll region
Diffstat (limited to 'tests/util.sh')
-rw-r--r--tests/util.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/util.sh b/tests/util.sh
index 3969db5..76b72b9 100644
--- a/tests/util.sh
+++ b/tests/util.sh
@@ -59,6 +59,15 @@ stdenv() {
# Close stdin so bfs doesn't think we're interactive
# dup() the standard fds for logging even when redirected
exec </dev/null {DUPOUT}>&1 {DUPERR}>&2
+
+ # Get the ttyname
+ if [ -t $DUPOUT ]; then
+ TTY=$(tty <&$DUPOUT)
+ elif [ -t $DUPERR ]; then
+ TTY=$(tty <&$DUPERR)
+ else
+ TTY=
+ fi
}
# Drop root priviliges or bail