mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-30 03:54:10 +01:00
If the vertical cursor movement crosses the scroll region, CUU and CUD
shouldn't be used even if VPA isn't present - in that case CUP should be used.
This commit is contained in:
parent
56157444de
commit
eb9826f65d
9
tty.c
9
tty.c
@ -1027,15 +1027,16 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
|
|||||||
change = thisy - cy; /* +ve up, -ve down */
|
change = thisy - cy; /* +ve up, -ve down */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use VPA if change is larger than absolute or if this change
|
* Try to use VPA if change is larger than absolute or if this change
|
||||||
* would cross the scroll region, otherwise use CUU/CUD.
|
* would cross the scroll region, otherwise use CUU/CUD.
|
||||||
*/
|
*/
|
||||||
if ((abs(change) > cy ||
|
if (abs(change) > cy ||
|
||||||
(change < 0 && cy - change > tty->rlower) ||
|
(change < 0 && cy - change > tty->rlower) ||
|
||||||
(change > 0 && cy - change < tty->rupper)) &&
|
(change > 0 && cy - change < tty->rupper)) {
|
||||||
tty_term_has(term, TTYC_VPA)) {
|
if (tty_term_has(term, TTYC_VPA)) {
|
||||||
tty_putcode1(tty, TTYC_VPA, cy);
|
tty_putcode1(tty, TTYC_VPA, cy);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
} else if (change > 0 && tty_term_has(term, TTYC_CUU)) {
|
} else if (change > 0 && tty_term_has(term, TTYC_CUU)) {
|
||||||
tty_putcode1(tty, TTYC_CUU, change);
|
tty_putcode1(tty, TTYC_CUU, change);
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user