summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-10-20 13:10:55 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-10-20 13:10:55 +0000
commit8bc68e8c40aaf77b917517394fddf14a7801e78e (patch)
treeb1cb1f6036a3fb50720aa33e89f39491897f9c6e /usr.bin/tmux/status.c
parent3a6f3af8a7b6534d78e9f9e4cedcb40ea237c84d (diff)
Clear status line with spaces again so reverse works, spotted by sthen.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index d54ad5f26a1..b21f53df3a6 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.169 2017/10/16 19:30:53 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.170 2017/10/20 13:10:54 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -340,7 +340,8 @@ status_redraw(struct client *c)
memcpy(&old_status, &c->status, sizeof old_status);
screen_init(&c->status, c->tty.sx, lines, 0);
screen_write_start(&ctx, NULL, &c->status);
- screen_write_clearscreen(&ctx, stdgc.bg);
+ for (offset = 0; offset < lines * c->tty.sx; offset++)
+ screen_write_putc(&ctx, &stdgc, ' ');
screen_write_stop(&ctx);
/* If the height is too small, blank status line. */
@@ -652,7 +653,7 @@ status_message_redraw(struct client *c)
struct screen old_status;
size_t len;
struct grid_cell gc;
- u_int lines;
+ u_int lines, offset;
if (c->tty.sx == 0 || c->tty.sy == 0)
return (0);
@@ -671,7 +672,9 @@ status_message_redraw(struct client *c)
style_apply(&gc, s->options, "message-style");
screen_write_start(&ctx, NULL, &c->status);
- screen_write_clearscreen(&ctx, gc.bg);
+ screen_write_cursormove(&ctx, 0, 0);
+ for (offset = 0; offset < lines * c->tty.sx; offset++)
+ screen_write_putc(&ctx, &gc, ' ');
screen_write_cursormove(&ctx, 0, lines - 1);
screen_write_nputs(&ctx, len, &gc, "%s", c->message_string);
screen_write_stop(&ctx);
@@ -832,10 +835,12 @@ status_prompt_redraw(struct client *c)
start = c->tty.sx;
screen_write_start(&ctx, NULL, &c->status);
- screen_write_clearscreen(&ctx, gc.bg);
- screen_write_cursormove(&ctx, 0, lines - 1);
+ screen_write_cursormove(&ctx, 0, 0);
+ for (offset = 0; offset < lines * c->tty.sx; offset++)
+ screen_write_putc(&ctx, &gc, ' ');
+ screen_write_cursormove(&ctx, 0, 0);
screen_write_nputs(&ctx, start, &gc, "%s", c->prompt_string);
- screen_write_cursormove(&ctx, start, lines - 1);
+ screen_write_cursormove(&ctx, start, 0);
left = c->tty.sx - start;
if (left == 0)