From d20da866a3e37d4b1c4f7480fbe76a2b58489b5f Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 6 Jan 2011 11:24:38 +0000 Subject: [PATCH] Resize properly. tput doesn't work inside a subshell. Use stty size. --- opt/bin/bigscreen | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/opt/bin/bigscreen b/opt/bin/bigscreen index df235b8..3f30b92 100755 --- a/opt/bin/bigscreen +++ b/opt/bin/bigscreen @@ -6,7 +6,11 @@ # # Resize only if we're at the default size. -if [ "$(tput lines)" = "24" ]; then - usize $(tput cols) 25 -fi +size=$(stty size) +oldcols=${size##* } +oldlines=${size%% *} +lines=${oldlines:-24} + +[ ${lines:-24} -lt 25 ] && lines=25 +[ $lines = $oldlines ] || usize $oldcols $lines exec screen ${1+"$@"} -- 2.7.4