From 37b156a8f99276ae441e4b705626bc8aae67b3f3 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Sun, 23 Apr 2023 05:20:15 -0700 Subject: [PATCH] Add timeout to raw_bg read, avoid hang on certain platforms --- grep+ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grep+ b/grep+ index c26ff84..3a91769 100755 --- a/grep+ +++ b/grep+ @@ -998,7 +998,7 @@ terminal_color() { echo -en "\033]${style_code};?\033\\" > /dev/tty # shellcheck disable=SC1003 - if IFS=';' read -r -d '\' raw_bg; then + if IFS=';' read -r -t 1 -d '\' raw_bg; then bg=$(echo "$raw_bg" | sed 's/^.*\;//;s/[^rgb:0-9a-f/]//g') bg=${bg#*:}