From afc29ac448ba3425d8a452794d3731c0f9fb2066 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 17 Oct 2018 14:57:40 +1100 Subject: [PATCH] general: Faster read on newer bash --- neofetch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index 833e8cf0..df321362 100755 --- a/neofetch +++ b/neofetch @@ -3573,7 +3573,10 @@ get_window_size() { # user input so we have to use read to store the out # -put as a variable. # The 1 second timeout is required for older bash - IFS=';t' read -d t -t 1 -sra term_size + case "${BASH_VERSINFO[0]}" in + 4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;; + *) IFS=';t' read -d t -t 1 -sra term_size ;; + esac unset IFS # Split the string into height/width.