From 72e7b1103d5aa9cf04b21296aa2b533c5be1ffcd Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 21 Feb 2016 14:49:41 +1100 Subject: [PATCH] Get the terminal size without the need of a loop --- fetch | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fetch b/fetch index 1101790f..b72b8f79 100755 --- a/fetch +++ b/fetch @@ -1815,10 +1815,7 @@ getimage () { # The ascape code above prints the output AFTER the prompt so this # loop below reads it as input. wtf xterm - while IFS= read -s -r -n 1 -t 0.25 char; do - [ "$char" == "t" ] && break - term_size+=$char - done + IFS= read -d t -s -r term_size # If $img isn't a file or the terminal doesn't support xterm escape sequences, # fallback to ascii mode.