Add formats for pane written/skipped bytes for debugging.

This commit is contained in:
nicm 2020-04-18 07:19:28 +00:00
parent baf1fca273
commit e153b928ff
4 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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);

2
tmux.1
View File

@ -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"

3
tmux.h
View File

@ -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;
};