summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-01-21 23:45:44 +0000
committernicm <nicm@openbsd.org>2012-01-21 23:45:44 +0000
commitf4d2f503bbaeab453de648d64c73487b9f132952 (patch)
tree9b9e2aeabaa6588bbdc620b6dbe94067271448cb
parentPCMCIA malo devices don't support WPA. (diff)
downloadwireguard-openbsd-f4d2f503bbaeab453de648d64c73487b9f132952.tar.xz
wireguard-openbsd-f4d2f503bbaeab453de648d64c73487b9f132952.zip
Show pane size in top right of display panes mode.
-rw-r--r--usr.bin/tmux/screen-redraw.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/usr.bin/tmux/screen-redraw.c b/usr.bin/tmux/screen-redraw.c
index f868401d522..6e8994882d6 100644
--- a/usr.bin/tmux/screen-redraw.c
+++ b/usr.bin/tmux/screen-redraw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-redraw.c,v 1.19 2011/11/15 23:19:51 nicm Exp $ */
+/* $OpenBSD: screen-redraw.c,v 1.20 2012/01/21 23:45:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -286,15 +286,7 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
if (wp->sx < len * 6 || wp->sy < 5) {
tty_cursor(tty, xoff + px - len / 2, yoff + py);
- memcpy(&gc, &grid_default_cell, sizeof gc);
- gc.data = '_'; /* not space */
- if (w->active == wp)
- colour_set_fg(&gc, active_colour);
- else
- colour_set_fg(&gc, colour);
- tty_attributes(tty, &gc);
- tty_puts(tty, buf);
- return;
+ goto draw_text;
}
px -= len * 3;
@@ -321,4 +313,21 @@ screen_redraw_draw_number(struct client *c, struct window_pane *wp)
}
px += 6;
}
+
+ len = xsnprintf(buf, sizeof buf, "%ux%u", wp->sx, wp->sy);
+ if (wp->sx < len || wp->sy < 6)
+ return;
+ tty_cursor(tty, xoff + wp->sx - len, yoff);
+
+draw_text:
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ gc.data = '_'; /* not space */
+ if (w->active == wp)
+ colour_set_fg(&gc, active_colour);
+ else
+ colour_set_fg(&gc, colour);
+ tty_attributes(tty, &gc);
+ tty_puts(tty, buf);
+
+ tty_cursor(tty, 0, 0);
}