aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2017-08-21 21:01:21 +0000
committernicm <nicm>2017-08-21 21:01:21 +0000
commit7ec2a2b9ce0d7045c604607f4fa28b380f8f37f8 (patch)
treefc669c76f42608b8dabf76040af5f3552b36ccc1 /tty.c
parent768740ae98e01002a6b34fee459deda514a0ff07 (diff)
downloadrtmux-7ec2a2b9ce0d7045c604607f4fa28b380f8f37f8.tar.gz
rtmux-7ec2a2b9ce0d7045c604607f4fa28b380f8f37f8.tar.bz2
rtmux-7ec2a2b9ce0d7045c604607f4fa28b380f8f37f8.zip
Do not emit \r\n to move to column 0 if there are margins, because it
will instead move to the margin left.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tty.c b/tty.c
index d83d4ced..68714cb9 100644
--- a/tty.c
+++ b/tty.c
@@ -1609,7 +1609,8 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy)
}
/* Zero on the next line. */
- if (cx == 0 && cy == thisy + 1 && thisy != tty->rlower) {
+ if (cx == 0 && cy == thisy + 1 && thisy != tty->rlower &&
+ (!tty_use_margin(tty) || tty->rleft == 0)) {
tty_putc(tty, '\r');
tty_putc(tty, '\n');
goto out;