Fix weird prompt issues

This commit is contained in:
Dylan Araps 2016-10-03 21:47:29 +11:00
parent 8a1eb28987
commit 9a0aa9938a
2 changed files with 7 additions and 3 deletions

View file

@ -48,7 +48,6 @@ printinfo () {
info linebreak info linebreak
info cols info cols
info linebreak
} }

View file

@ -2807,13 +2807,18 @@ dynamicprompt() {
# If the info is higher than the ascii/image place the prompt # If the info is higher than the ascii/image place the prompt
# based on the info height instead of the ascii/image height. # based on the info height instead of the ascii/image height.
if [ "${lines:-0}" -lt "${info_height:-0}" ]; then if [ "${lines:-0}" -lt "${info_height:-0}" ]; then
lines="$((info_height - lines - 2))" lines="0"
else else
lines="$((lines - info_height - 2))" lines="$((lines - info_height - 4))"
fi fi
# Set the prompt location # Set the prompt location
[ "$image" != "off" ] && printf "\033[${lines/-*/0}B" [ "$image" != "off" ] && printf "\033[${lines/-*/0}B"
# Add some padding if the lines are above 0
if [ "$lines" -gt 0 ]; then
printf "\n\n"
fi
} }
# }}} # }}}