diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-04-18 00:01:30 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-04-18 00:01:30 +0100 |
commit | 87d79e6d367f725d831cf04357e6a354908ad551 (patch) | |
tree | e540c3321b4811d5537c68a8080ebb1393539626 /tty.c | |
parent | 857fca1095861b254f9585a7ddc4404a8b722e8a (diff) | |
parent | a7a9460d2790161f7bb60c4047acf32d3aa93ed9 (diff) | |
download | rtmux-87d79e6d367f725d831cf04357e6a354908ad551.tar.gz rtmux-87d79e6d367f725d831cf04357e6a354908ad551.tar.bz2 rtmux-87d79e6d367f725d831cf04357e6a354908ad551.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1739,7 +1739,10 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) for (i = 0; i < ctx->num; i++) tty_putc(tty, '\n'); } else { - tty_cursor(tty, 0, tty->cy); + if (tty->cy == UINT_MAX) + tty_cursor(tty, 0, 0); + else + tty_cursor(tty, 0, tty->cy); tty_putcode1(tty, TTYC_INDN, ctx->num); } } @@ -2063,8 +2066,12 @@ tty_region(struct tty *tty, u_int rupper, u_int rlower) * flag so further output causes a line feed). As a workaround, do an * explicit move to 0 first. */ - if (tty->cx >= tty->sx) - tty_cursor(tty, 0, tty->cy); + if (tty->cx >= tty->sx) { + if (tty->cy == UINT_MAX) + tty_cursor(tty, 0, 0); + else + tty_cursor(tty, 0, tty->cy); + } tty_putcode2(tty, TTYC_CSR, tty->rupper, tty->rlower); tty->cx = tty->cy = UINT_MAX; @@ -2144,6 +2151,9 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy) u_int thisx, thisy; int change; + if (tty->flags & TTY_BLOCK) + return; + if (cx > tty->sx - 1) cx = tty->sx - 1; |