Only get column count if we need it.

This commit is contained in:
Dylan 2016-02-01 11:05:46 +11:00
parent 4f068c4f4c
commit f7107a8ffb

6
fetch
View file

@ -1573,6 +1573,9 @@ getimage () {
return
fi
# Get columns
columns=$(tput cols)
# Image size is half of the terminal
imgsize=$((columns * font_width / split_size))
@ -2103,9 +2106,6 @@ trap 'printf "\033[?25h"; clear; exit' 2
# If the script exits for any reason, unhide the cursor.
trap 'printf "\033[?25h"' EXIT
# Get columns
columns=$(tput cols)
if [ "$image" != "off" ]; then
# Hide the cursor
printf "\033[?25l"