From 285a3b752230f4612c53f58aa42556e6c3d5a32e Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 22 May 2026 12:44:08 +0100 Subject: [PATCH] Fix up SIXEL with recent changes. --- screen-write.c | 2 +- tmux.h | 4 ++++ tty.c | 14 ++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/screen-write.c b/screen-write.c index 97a11998..97714a5a 100644 --- a/screen-write.c +++ b/screen-write.c @@ -2463,7 +2463,7 @@ screen_write_sixelimage(struct screen_write_ctx *ctx, struct sixel_image *si, screen_write_collect_flush(ctx, 0, __func__); screen_write_initctx(ctx, &ttyctx, 0); - ttyctx.ptr = image_store(s, si); + ttyctx.image = image_store(s, si); tty_write(tty_cmd_sixelimage, &ttyctx); diff --git a/tmux.h b/tmux.h index 50092e90..869f84eb 100644 --- a/tmux.h +++ b/tmux.h @@ -1754,6 +1754,10 @@ struct tty_ctx { const char *data; size_t size; } sel; + +#ifdef ENABLE_SIXEL + struct image *image; +#endif }; /* diff --git a/tty.c b/tty.c index a11c5af3..ea1705d3 100644 --- a/tty.c +++ b/tty.c @@ -1479,9 +1479,11 @@ tty_set_client_cb(struct tty_ctx *ttyctx, struct client *c) if (wp->layout_cell == NULL) return (0); - /* Set the properties relevant to the current client. */ - ttyctx->bigger = tty_window_offset(&c->tty, &ttyctx->wox, &ttyctx->woy, - &ttyctx->wsx, &ttyctx->wsy); + if (tty_window_offset(&c->tty, &ttyctx->wox, &ttyctx->woy, &ttyctx->wsx, + &ttyctx->wsy)) + ttyctx->flags |= TTY_CTX_WINDOW_BIGGER; + else + ttyctx->flags &= ~TTY_CTX_WINDOW_BIGGER; ttyctx->yoff = ttyctx->ryoff = wp->yoff; if (status_at_line(c) == 0) @@ -1510,10 +1512,10 @@ tty_draw_images(struct client *c, struct window_pane *wp, struct screen *s) ttyctx.sx = wp->sx; ttyctx.sy = wp->sy; - ttyctx.ptr = im; + ttyctx.image = im; ttyctx.arg = wp; ttyctx.set_client_cb = tty_set_client_cb; - ttyctx.allow_invisible_panes = 1; + ttyctx.flags |= TTY_CTX_INVISIBLE_PANES; tty_write_one(tty_cmd_sixelimage, c, &ttyctx); } } @@ -2122,7 +2124,7 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx) void tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx) { - struct image *im = ctx->ptr; + struct image *im = ctx->image; struct sixel_image *si = im->data; struct sixel_image *new; char *data;