summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/status.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-12-27 13:55:43 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-12-27 13:55:43 +0000
commitb26adbb6edc229aa33e28689d781a4bbe6e66c6b (patch)
tree2fc0d477cf7402f8a07877168d09ef10c2b43c62 /usr.bin/tmux/status.c
parente324f2573b6fddc960b714b943622c27a3baa020 (diff)
Draw command prompt correctly with status line off.
Diffstat (limited to 'usr.bin/tmux/status.c')
-rw-r--r--usr.bin/tmux/status.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index 2d0d652e2f8..12a9ebe4df0 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.172 2017/12/18 12:39:34 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.173 2017/12/27 13:55:42 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -659,9 +659,10 @@ status_message_redraw(struct client *c)
memcpy(&old_status, &c->status, sizeof old_status);
lines = status_line_size(c->session);
- if (lines <= 1)
+ if (lines <= 1) {
+ lines = 1;
screen_init(&c->status, c->tty.sx, 1, 0);
- else
+ } else
screen_init(&c->status, c->tty.sx, lines, 0);
len = screen_write_strlen("%s", c->message_string);
@@ -811,9 +812,10 @@ status_prompt_redraw(struct client *c)
memcpy(&old_status, &c->status, sizeof old_status);
lines = status_line_size(c->session);
- if (lines <= 1)
+ if (lines <= 1) {
+ lines = 1;
screen_init(&c->status, c->tty.sx, 1, 0);
- else
+ } else
screen_init(&c->status, c->tty.sx, lines, 0);
len = screen_write_strlen("%s", c->prompt_string);