Cursor Position: Fix issues when using URxvt+Padding
This commit is contained in:
parent
5dddaa0b26
commit
d09cf58790
28
neofetch
28
neofetch
|
@ -2932,12 +2932,38 @@ kdeconfigdir() {
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
# Terminal info {{{
|
||||||
|
#
|
||||||
|
# Parse terminal config files to get
|
||||||
|
# info about padding. Due to how w3m-img
|
||||||
|
# works padding around the terminal throws
|
||||||
|
# off the cursor placement calculation in
|
||||||
|
# specific terminals.
|
||||||
|
#
|
||||||
|
# Note: This issue only seems to affect
|
||||||
|
# URxvt.
|
||||||
|
|
||||||
|
gettermpadding() {
|
||||||
|
[ -z "$term" ] && getterm
|
||||||
|
|
||||||
|
case "$term" in
|
||||||
|
"URxvt"*)
|
||||||
|
border="$(xrdb -query | grep -i "\(URxvt\|\*\)\.InternalBorder")"
|
||||||
|
border="${border/*:}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# }}}
|
||||||
|
|
||||||
# Dynamic prompt location {{{
|
# Dynamic prompt location {{{
|
||||||
|
|
||||||
dynamicprompt() {
|
dynamicprompt() {
|
||||||
# Calculate image height in terminal cells.
|
# Calculate image height in terminal cells.
|
||||||
if [ "$image" != "ascii" ]; then
|
if [ "$image" != "ascii" ]; then
|
||||||
lines="$((height / font_height))"
|
gettermpadding
|
||||||
|
|
||||||
|
lines="$(((height + border) / font_height))"
|
||||||
cursor_yoffset="$((${yoffset:-1} / font_height))"
|
cursor_yoffset="$((${yoffset:-1} / font_height))"
|
||||||
else
|
else
|
||||||
cursor_yoffset="0 - 2"
|
cursor_yoffset="0 - 2"
|
||||||
|
|
Reference in New Issue