aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--format.c1
-rw-r--r--tmux.11
-rw-r--r--tmux.h1
-rw-r--r--tty.c9
4 files changed, 8 insertions, 4 deletions
diff --git a/format.c b/format.c
index 7408ba34..c1a91a85 100644
--- a/format.c
+++ b/format.c
@@ -1174,6 +1174,7 @@ format_defaults_client(struct format_tree *ft, struct client *c)
format_add_tv(ft, "client_created", &c->creation_time);
format_add_tv(ft, "client_activity", &c->activity_time);
+ format_add(ft, "client_written", "%zu", tty->written);
name = server_client_get_key_table(c);
if (strcmp(c->keytable->name, name) == 0)
diff --git a/tmux.1 b/tmux.1
index 98f477c4..873a63b2 100644
--- a/tmux.1
+++ b/tmux.1
@@ -3525,6 +3525,7 @@ The following variables are available, where appropriate:
.It Li "client_tty" Ta "" Ta "Pseudo terminal of client"
.It Li "client_utf8" Ta "" Ta "1 if client supports utf8"
.It Li "client_width" Ta "" Ta "Width of client"
+.It Li "client_written" Ta "" Ta "Bytes written to client"
.It Li "command" Ta "" Ta "Name of command in use, if any"
.It Li "command_list_name" Ta "" Ta "Command name if listing commands"
.It Li "command_list_alias" Ta "" Ta "Command alias if listing commands"
diff --git a/tmux.h b/tmux.h
index 3deab57d..79601e1f 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1047,6 +1047,7 @@ struct tty {
struct evbuffer *in;
struct event event_out;
struct evbuffer *out;
+ size_t written;
struct termios tio;
diff --git a/tty.c b/tty.c
index 43ea1749..14906cc3 100644
--- a/tty.c
+++ b/tty.c
@@ -427,6 +427,7 @@ tty_add(struct tty *tty, const char *buf, size_t len)
evbuffer_add(tty->out, buf, len);
log_debug("%s: %.*s", c->name, (int)len, (const char *)buf);
+ tty->written += len;
if (tty_log_fd != -1)
write(tty_log_fd, buf, len);
@@ -880,7 +881,7 @@ tty_cmd_clearcharacter(struct tty *tty, const struct tty_ctx *ctx)
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
if (tty_term_has(tty->term, TTYC_ECH) &&
- !tty_fake_bce(tty, ctx->wp, ctx->bg))
+ !tty_fake_bce(tty, ctx->wp, 8))
tty_putcode1(tty, TTYC_ECH, ctx->num);
else
tty_repeat_space(tty, ctx->num);
@@ -989,7 +990,7 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
return;
if (!tty_pane_full_width(tty, ctx) ||
- tty_fake_bce(tty, ctx->wp, ctx->bg) ||
+ tty_fake_bce(tty, ctx->wp, 8) ||
!tty_term_has(tty->term, TTYC_CSR) ||
!tty_term_has(tty->term, TTYC_RI)) {
tty_redraw_region(tty, ctx);
@@ -1014,7 +1015,7 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
return;
if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) ||
- tty_fake_bce(tty, wp, ctx->bg) ||
+ tty_fake_bce(tty, wp, 8) ||
!tty_term_has(tty->term, TTYC_CSR)) {
tty_redraw_region(tty, ctx);
return;
@@ -1045,7 +1046,7 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx)
u_int i;
if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) ||
- tty_fake_bce(tty, wp, ctx->bg) ||
+ tty_fake_bce(tty, wp, 8) ||
!tty_term_has(tty->term, TTYC_CSR)) {
tty_redraw_region(tty, ctx);
return;