aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-03 17:04:11 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-03 17:04:11 +0100
commitfff85d854e7a29ab1fbf0b3867a38b52b5cf60c8 (patch)
treeda81ec2025f9be5ce0dcb5513c8b1e9581a3b134 /status.c
parent4d16df931274e12a42348f3bc09d9810a52e2e00 (diff)
parentcf6075fb29fcd86f11a1f2cc6e906c62f39d4032 (diff)
downloadrtmux-fff85d854e7a29ab1fbf0b3867a38b52b5cf60c8.tar.gz
rtmux-fff85d854e7a29ab1fbf0b3867a38b52b5cf60c8.tar.bz2
rtmux-fff85d854e7a29ab1fbf0b3867a38b52b5cf60c8.zip
Merge branch 'obsd-master'
Diffstat (limited to 'status.c')
-rw-r--r--status.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/status.c b/status.c
index 89912114..332f8fd6 100644
--- a/status.c
+++ b/status.c
@@ -320,7 +320,7 @@ status_redraw(struct client *c)
struct session *s = c->session;
struct screen_write_ctx ctx;
struct grid_cell gc;
- u_int lines, i, width = c->tty.sx;
+ u_int lines, i, n, width = c->tty.sx;
int flags, force = 0, changed = 0;
struct options_entry *o;
union options_value *ov;
@@ -364,15 +364,17 @@ status_redraw(struct client *c)
/* Write the status lines. */
o = options_get(s->options, "status-format");
- if (o == NULL)
- screen_write_clearscreen(&ctx, gc.bg);
- else {
+ if (o == NULL) {
+ for (n = 0; n < width * lines; n++)
+ screen_write_putc(&ctx, &gc, ' ');
+ } else {
for (i = 0; i < lines; i++) {
screen_write_cursormove(&ctx, 0, i, 0);
ov = options_array_get(o, i);
if (ov == NULL) {
- screen_write_clearline(&ctx, gc.bg);
+ for (n = 0; n < width; n++)
+ screen_write_putc(&ctx, &gc, ' ');
continue;
}
sle = &sl->entries[i];
@@ -386,7 +388,10 @@ status_redraw(struct client *c)
}
changed = 1;
- screen_write_clearline(&ctx, gc.bg);
+ for (n = 0; n < width; n++)
+ screen_write_putc(&ctx, &gc, ' ');
+ screen_write_cursormove(&ctx, 0, i, 0);
+
status_free_ranges(&sle->ranges);
format_draw(&ctx, &gc, width, expanded, &sle->ranges);