summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/format.c5
-rw-r--r--usr.bin/tmux/screen-write.c6
-rw-r--r--usr.bin/tmux/tmux.16
-rw-r--r--usr.bin/tmux/tmux.h5
4 files changed, 17 insertions, 5 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index ce5d8a774bd..fc829d0c1b8 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.242 2020/04/16 14:25:35 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.243 2020/04/18 07:19:28 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2690,6 +2690,9 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp)
format_add(ft, "history_limit", "%u", gd->hlimit);
format_add_cb(ft, "history_bytes", format_cb_history_bytes);
+ format_add(ft, "pane_written", "%zu", wp->written);
+ format_add(ft, "pane_skipped", "%zu", wp->skipped);
+
if (window_pane_index(wp, &idx) != 0)
fatalx("index not found");
format_add(ft, "pane_index", "%u", idx);
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 74b2158b5ed..65a98e402de 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.168 2020/04/17 15:44:58 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.169 2020/04/18 07:19:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -174,6 +174,10 @@ screen_write_stop(struct screen_write_ctx *ctx)
log_debug("%s: %u cells (%u written, %u skipped)", __func__,
ctx->cells, ctx->written, ctx->skipped);
+ if (ctx->wp != NULL) {
+ ctx->wp->written += ctx->written;
+ ctx->wp->skipped += ctx->skipped;
+ }
if (ctx->sync) {
screen_write_initctx(ctx, &ttyctx, 0);
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index e5179be8408..134f25d2a31 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.742 2020/04/17 08:03:22 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.743 2020/04/18 07:19:29 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 17 2020 $
+.Dd $Mdocdate: April 18 2020 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -4450,6 +4450,7 @@ The following variables are available, where appropriate:
.It Li "pane_pipe" Ta "" Ta "1 if pane is being piped"
.It Li "pane_right" Ta "" Ta "Right of pane"
.It Li "pane_search_string" Ta "" Ta "Last search string in copy mode"
+.It Li "pane_skipped" Ta "" Ta "Bytes skipped as not visible in pane"
.It Li "pane_start_command" Ta "" Ta "Command pane started with"
.It Li "pane_synchronized" Ta "" Ta "1 if pane is synchronized"
.It Li "pane_tabs" Ta "" Ta "Pane tab positions"
@@ -4457,6 +4458,7 @@ The following variables are available, where appropriate:
.It Li "pane_top" Ta "" Ta "Top of pane"
.It Li "pane_tty" Ta "" Ta "Pseudo terminal of pane"
.It Li "pane_width" Ta "" Ta "Width of pane"
+.It Li "pane_written" Ta "" Ta "Bytes written by pane (aside from redrawing)"
.It Li "pid" Ta "" Ta "Server PID"
.It Li "popup_key" Ta "" Ta "Key pressed in popup"
.It Li "popup_mouse_x" Ta "" Ta "Mouse X position in popup"
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 37d2536e3f4..6d99000d581 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.1004 2020/04/18 06:20:50 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1005 2020/04/18 07:19:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -934,6 +934,9 @@ struct window_pane {
char *searchstr;
int searchregex;
+ u_int written;
+ u_int skipped;
+
TAILQ_ENTRY(window_pane) entry;
RB_ENTRY(window_pane) tree_entry;
};