From 59b1c525c4c7c254dce702fca0fa472616a976d2 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 22 May 2024 16:12:37 -0400 Subject: tests: Print progress outside the scroll region --- tests/util.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/util.sh') 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 &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 -- cgit v1.2.3