Fix prompt issues
This commit is contained in:
parent
efcc7e8273
commit
24fde4f6a6
17
neofetch
17
neofetch
|
@ -3309,18 +3309,25 @@ fi
|
||||||
# Print the info
|
# Print the info
|
||||||
printinfo
|
printinfo
|
||||||
|
|
||||||
if [ "$image" != "off" ]; then
|
# Dynamic prompt location.
|
||||||
|
case "$image" in
|
||||||
|
"ascii")
|
||||||
# Get cursor position
|
# Get cursor position
|
||||||
info_height="$(stty -echo; IFS=';' read -rdR -t 1 -d c -p $'\033[6n\033[c' ROW COL; printf "%s" "${ROW#*[}"; stty echo)"
|
info_height="$(stty -echo; IFS=';' read -rdR -t 1 -d c -p $'\033[6n\033[c' ROW COL; printf "%s" "${ROW#*[}"; stty echo)"
|
||||||
|
|
||||||
# Calculate image height in terminal cells.
|
|
||||||
lines="$((${width:-1} / ${font_width:-1} / 2 + 3))"
|
|
||||||
|
|
||||||
# Set cursor position dynamically based on height of ascii/text.
|
# Set cursor position dynamically based on height of ascii/text.
|
||||||
[ "${lines:-0}" -lt "${info_height:-0}" ] && lines="$info_height"
|
[ "${lines:-0}" -lt "${info_height:-0}" ] && lines="$info_height"
|
||||||
|
;;
|
||||||
|
|
||||||
|
"off") ;;
|
||||||
|
|
||||||
|
# Calculate image height in terminal cells.
|
||||||
|
*) lines="$((${width:-1} / ${font_width:-1} / 2 + 3))" ;;
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Set the prompt location
|
||||||
printf "%b%s" "\033[${lines}H"
|
printf "%b%s" "\033[${lines}H"
|
||||||
fi
|
|
||||||
|
|
||||||
# Re-enable line wrap
|
# Re-enable line wrap
|
||||||
[ "$line_wrap" == "off" ] && printf "%b%s" "\033[?7h"
|
[ "$line_wrap" == "off" ] && printf "%b%s" "\033[?7h"
|
||||||
|
|
Reference in New Issue