If images are disabled don't clear terminal output or mess around with cursor location

This commit is contained in:
Dylan 2016-01-17 17:17:13 +11:00
parent 822ed78efc
commit f8ef1b93c7

21
fetch
View file

@ -1122,12 +1122,13 @@ termsize=${termsize/$'\n'/ }
lines=${termsize% *}
columns=${termsize#* }
# Get image
[ "$image" != "off" ] && getimage
if [ "$image" != "off" ]; then
getimage
# Clear the terminal and hide the cursor
printf "\e[?25l"
clear
# Clear the terminal and hide the cursor
clear
printf "\e[?25l"
fi
# Disable line wrap
[ "$line_wrap" == "off" ] && printf '\e[?7l'
@ -1137,17 +1138,17 @@ colors
bold
printinfo
# Display the image
[ "$image" != "off" ] && \
if [ "$image" != "off" ]; then
printf "%b%s" "0;1;$xoffset;$yoffset;$imgsize;$imgsize;;;;;$img\n4;\n3;" |\
$w3m_img_path
# Move cursor to bottom and redisplay it.
printf "%b%s" "\e[${lines}H\e[${prompt_height}A\e[?25h"
fi
# Enable line wrap again
[ "$line_wrap" == "off" ] && printf '\e[?7h'
# Move cursor to bottom and redisplay it.
printf "%b%s" "\e[${lines}H\e[${prompt_height}A\e[?25h"
# If enabled take a screenshot
[ "$scrot" == "on" ] && takescrot