summaryrefslogtreecommitdiffstats
path: root/tests/color.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/color.sh')
-rw-r--r--tests/color.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/color.sh b/tests/color.sh
index 4f4312e..9e2e0f6 100644
--- a/tests/color.sh
+++ b/tests/color.sh
@@ -46,9 +46,7 @@ show_bar() {
# Name the pipe deterministically based on the ttyname, so that concurrent
# tests.sh runs on the same terminal (e.g. make -jN check) cooperate
- local pipe
- pipe=$(printf '%s' "$TTY" | tr '/' '-')
- pipe="${TMPDIR:-/tmp}/bfs$pipe.bar"
+ local pipe="${TMPDIR:-/tmp}/bfs${TTY//\//-}.bar"
if mkfifo "$pipe" 2>/dev/null; then
# We won the race, create the background process to manage the bar
@@ -78,7 +76,7 @@ hide_bar() {
# The background process that muxes multiple status bars for one TTY
bar_proc() {
# Read from the pipe, write to the TTY
- exec <"$1" >"$TTY"
+ exec <"$1" >/dev/tty
# Delete the pipe when done
defer rm "$1"
@@ -133,7 +131,7 @@ bar_proc() {
# Resize the status bar
resize_bar() {
# Bash gets $LINES from stderr, so if it's redirected use tput instead
- TTY_HEIGHT="${LINES:-$(tput lines 2>"$TTY")}"
+ TTY_HEIGHT="${LINES:-$(tput lines 2>/dev/tty)}"
if ((BAR_HEIGHT == 0)); then
return