general: Fix prompt issues 2

This commit is contained in:
Dylan Araps 2018-05-25 06:05:31 +10:00
parent e8ab52de7d
commit bff6cf3b1a

View file

@ -4201,20 +4201,20 @@ kde_config_dir() {
dynamic_prompt() { dynamic_prompt() {
[[ "$image_backend" == "off" ]] && { printf "\n"; return; } [[ "$image_backend" == "off" ]] && { printf "\n"; return; }
[[ "$image_backend" != "ascii" ]] && ((lines+=1000)) [[ "$image_backend" != "ascii" ]] && { printf "%b" "\e[1000;0H"; return; }
# If the ascii art is taller than the info. # If the ascii art is taller than the info.
if ((lines > info_height)); then if ((lines > info_height)); then
lines="$((lines - info_height + 1))" prompt="$((lines - info_height + 1))"
else else
lines=1 prompt=1
fi fi
# Set the prompt location. # Set the prompt location.
if ((lines >= 1)); then if ((lines >= 1)); then
case "$kernel_name" in case "$kernel_name" in
"OpenBSD") tput cud "$lines" ;; "OpenBSD") tput cud "$prompt" ;;
*) printf "%b" "\e[${lines}B" ;; *) printf "\n\n%b" "\e[${prompt}D" ;;
esac esac
fi fi
} }