summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-05-03 10:00:48 +0000
committernicm <nicm@openbsd.org>2019-05-03 10:00:48 +0000
commitd90eabad1116bf869b83d0e400cf3d79cecd1977 (patch)
treebedb8ccf974f81037fd6d9282d5087db43ee4b3f
parentIn man(1) mode, when the first argument starts with a digit, (diff)
downloadwireguard-openbsd-d90eabad1116bf869b83d0e400cf3d79cecd1977.tar.xz
wireguard-openbsd-d90eabad1116bf869b83d0e400cf3d79cecd1977.zip
Fix reverse attribute in status line, GitHub issue 1709.
-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 6b131791a66..fc638f208f1 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.196 2019/04/26 11:38:51 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.197 2019/05/03 10:00:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);