summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tty.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-10-09 07:23:28 +0000
committernicm <nicm@openbsd.org>2009-10-09 07:23:28 +0000
commite5ab4f867a6bcb012e5b0f42f1cfd4585f582886 (patch)
treea1c1636f8601ad0ea8d1a97d69b2ee79120e1e16 /usr.bin/tmux/tty.c
parentinitialize the disk size instead of getting a random value (always 0) off (diff)
downloadwireguard-openbsd-e5ab4f867a6bcb012e5b0f42f1cfd4585f582886.tar.xz
wireguard-openbsd-e5ab4f867a6bcb012e5b0f42f1cfd4585f582886.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 'usr.bin/tmux/tty.c')
-rw-r--r--usr.bin/tmux/tty.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c
index 12ed1acd82b..4511036451c 100644
--- a/usr.bin/tmux/tty.c
+++ b/usr.bin/tmux/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.34 2009/09/23 12:03:31 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.35 2009/10/09 07:23:28 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);
}
}