diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-10-28 22:01:13 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-10-28 22:01:13 +0100 |
commit | 60cacdffea6683d53402660c51342125b8aab2b2 (patch) | |
tree | c5fc11d58f01d92b5964d728fe68175669af0d97 /tty.c | |
parent | c77924bb56800c671d96aa64b887d1ddf033ad94 (diff) | |
parent | 4acad43013b7bb5f91103a68cfce591b1980ae17 (diff) | |
download | rtmux-60cacdffea6683d53402660c51342125b8aab2b2.tar.gz rtmux-60cacdffea6683d53402660c51342125b8aab2b2.tar.bz2 rtmux-60cacdffea6683d53402660c51342125b8aab2b2.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -2278,17 +2278,25 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy) if (tty->flags & TTY_BLOCK) return; - if (cx > tty->sx - 1) - cx = tty->sx - 1; - thisx = tty->cx; thisy = tty->cy; + /* + * If in the automargin space, and want to be there, do not move. + * Otherwise, force the cursor to be in range (and complain). + */ + if (cx == thisx && cy == thisy && cx == tty->sx) + return; + if (cx > tty->sx - 1) { + log_debug("%s: x too big %u > %u", __func__, cx, tty->sx - 1); + cx = tty->sx - 1; + } + /* No change. */ if (cx == thisx && cy == thisy) return; - /* Very end of the line, just use absolute movement. */ + /* Currently at the very end of the line - use absolute movement. */ if (thisx > tty->sx - 1) goto absolute; |