From fc776921d5e19f5bfd71e2d88adc8b2977867508 Mon Sep 17 00:00:00 2001 From: Eric Warnke Date: Wed, 26 Oct 2016 09:59:22 -0400 Subject: [PATCH 1/3] stty is more compatible and does not require any additional dependancies for busybox --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index dfed93a1..2f55e1b0 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -33,8 +33,8 @@ IPv4_address="" IPv6_address="" # Find the rows and columns -rows=$(tput lines) -columns=$(tput cols) +rows=$(stty size | awk '{print $1}') +columns=$(stty size | awk '{print $2}') # Divide by two so the dialogs take up half of the screen, which looks nice. r=$(( rows / 2 )) From ac8d24a1cea3a09877d97299e24adb2d8ec0cbd7 Mon Sep 17 00:00:00 2001 From: Eric Warnke Date: Wed, 26 Oct 2016 10:08:23 -0400 Subject: [PATCH 2/3] Even with no detected screen size, it should presume 80x24 --- automated install/basic-install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 2f55e1b0..7af51c5b 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -32,9 +32,10 @@ useUpdateVars=false IPv4_address="" IPv6_address="" -# Find the rows and columns -rows=$(stty size | awk '{print $1}') -columns=$(stty size | awk '{print $2}') +# Find the rows and columns will default to 80x24 is it can not be detected +screen_size=$(stty size 2>/dev/null || echo 24 80) +rows=$(echo $screen_size | awk '{print $1}') +columns=$(echo $screen_size | awk '{print $2}') # Divide by two so the dialogs take up half of the screen, which looks nice. r=$(( rows / 2 )) From 4ed6e4d016d9c0aead21edb92cada243d248bd49 Mon Sep 17 00:00:00 2001 From: Eric Warnke Date: Wed, 26 Oct 2016 10:44:15 -0400 Subject: [PATCH 3/3] Tiny screens get sane minimums --- automated install/basic-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 7af51c5b..ae3a4529 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -40,6 +40,9 @@ columns=$(echo $screen_size | awk '{print $2}') # Divide by two so the dialogs take up half of the screen, which looks nice. r=$(( rows / 2 )) c=$(( columns / 2 )) +# Unless the screen is tiny +r=$(( r < 20 ? 20 : r )) +c=$(( c < 70 ? 70 : c )) ######## Undocumented Flags. Shhh ######## skipSpaceCheck=false