diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-02-15 20:58:21 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-02-15 20:58:43 +0200 |
commit | 95f861f2af6858412445371c621ebd1a00e16f81 (patch) | |
tree | 59978df025ad96986781863e94e600e280a9f0a7 | |
parent | 19de5926253c0b5a060997dbc0f33711336adfeb (diff) | |
download | slackupgrade-95f861f2af6858412445371c621ebd1a00e16f81.tar.gz slackupgrade-95f861f2af6858412445371c621ebd1a00e16f81.tar.bz2 |
Use tput or stty to get the terminal size
-rw-r--r-- | slackupgrade | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/slackupgrade b/slackupgrade index e4335a0..9be3e98 100644 --- a/slackupgrade +++ b/slackupgrade @@ -385,3 +385,4 @@ function download_all() { info "downloading packages" - if [ ${COLUMNS:-0} -lt 10 ]; then + cols=$(tput cols 2>/dev/null || stty size 2>/dev/null | cut -d' ' -f2) + if [ ${cols:-0} -lt 10 ]; then progressbar=0 @@ -390,3 +391,3 @@ function download_all() { total=$(wc -l candidates | cut -d ' ' -f 1) - width=$(( $COLUMNS - 7 )) + width=$(( $cols - 7 )) fi |