aboutsummaryrefslogtreecommitdiff
path: root/tty.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-10-09 07:23:28 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-10-09 07:23:28 +0000
commitd5281848361ede97d871553b011a706457acabd0 (patch)
tree4f975c4170c364bb90251771d325da8362c97ddb /tty.c
parent2cb2bb8257b0d9258381829752bf12b29e35547c (diff)
downloadrtmux-d5281848361ede97d871553b011a706457acabd0.tar.gz
rtmux-d5281848361ede97d871553b011a706457acabd0.tar.bz2
rtmux-d5281848361ede97d871553b011a706457acabd0.zip
Be less aggressive about turning the cursor off, only explicitly turn it off
when tmux is redrawing, otherwise leave in the state set by the application.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tty.c b/tty.c
index 774808db..8dde904c 100644
--- a/tty.c
+++ b/tty.c
@@ -524,6 +524,8 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
const struct grid_utf8 *gu;
u_int i, sx;
+ tty_update_mode(tty, tty->mode & ~MODE_CURSOR);
+
sx = screen_size_x(s);
if (sx > s->grid->linedata[s->grid->hsize + py].cellsize)
sx = s->grid->linedata[s->grid->hsize + py].cellsize;
@@ -548,8 +550,10 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
tty_cell(tty, gc, gu);
}
- if (sx >= tty->sx)
+ if (sx >= tty->sx) {
+ tty_update_mode(tty, tty->mode);
return;
+ }
tty_reset(tty);
tty_cursor(tty, sx, py, ox, oy);
@@ -559,6 +563,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int py, u_int ox, u_int oy)
for (i = sx; i < screen_size_x(s); i++)
tty_putc(tty, ' ');
}
+ tty_update_mode(tty, tty->mode);
}
void
@@ -587,7 +592,6 @@ tty_write(void (*cmdfn)(
if (c->session->curw->window == wp->window) {
if (c->tty.flags & TTY_FREEZE || c->tty.term == NULL)
continue;
- tty_update_mode(&c->tty, c->tty.mode & ~MODE_CURSOR);
cmdfn(&c->tty, ctx);
}
}