From 5c0db5a293c054c1188d4304a9484e5c6d833e83 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 9 Jun 2026 21:31:16 +0000 Subject: [PATCH] Preserve the original text in the first line for display-panes. --- cmd-display-panes.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd-display-panes.c b/cmd-display-panes.c index 7470587a..054c3c35 100644 --- a/cmd-display-panes.c +++ b/cmd-display-panes.c @@ -84,20 +84,21 @@ cmd_display_panes_draw_format(struct screen_redraw_ctx *ctx, struct client *c = ctx->c; struct tty *tty = &c->tty; struct session *s = c->session; - struct screen screen; + struct screen *sc = wp->screen, screen; struct screen_write_ctx sctx; struct visible_ranges *r; struct visible_range *ri; const char *format; char *expanded; u_int i, px = ctx->ox + xoff; - struct tty_style_ctx style_ctx = { .defaults = gc }; format = options_get_string(s->options, "display-panes-format"); expanded = format_single(NULL, format, c, s, s->curw, wp); screen_init(&screen, sx, 1, 0); screen_write_start(&sctx, &screen); + screen_write_fast_copy(&sctx, sc, 0, sc->grid->hsize, sx, 1); + screen_write_cursormove(&sctx, 0, 0, 0); format_draw(&sctx, gc, sx, expanded, NULL, 0); screen_write_stop(&sctx); free(expanded); @@ -106,7 +107,7 @@ cmd_display_panes_draw_format(struct screen_redraw_ctx *ctx, for (i = 0; i < r->used; i++) { ri = &r->ranges[i]; tty_draw_line(tty, &screen, ri->px - px, 0, ri->nx, - ri->px - ctx->ox, yoff, &style_ctx); + ri->px - ctx->ox, yoff, NULL); } screen_free(&screen); }