mirror of
https://github.com/tmux/tmux.git
synced 2026-03-07 00:05:33 +00:00
Add support for the kitty graphics protocol
Kitty-capable terminals (kitty, ghostty, and others) can display inline images via APC escape sequences. Kitty's image support uses a passthrough model: APC sequences from programs running inside panes are relayed verbatim to the outer terminal with cursor positioning adjusted for the pane offset. The outer terminal handles all image rendering and therefore itself must be kitty-aware.
This commit is contained in:
@@ -667,6 +667,16 @@ screen_redraw_screen(struct client *c)
|
||||
}
|
||||
if (flags & CLIENT_REDRAWWINDOW) {
|
||||
log_debug("%s: redrawing panes", c->name);
|
||||
#ifdef ENABLE_KITTY
|
||||
/*
|
||||
* Delete all kitty image placements before redrawing panes.
|
||||
* This must happen unconditionally — even when the new window
|
||||
* has no images — so that images from the previous window
|
||||
* (or from a `reset` in the shell) are cleared from the outer
|
||||
* terminal before new content is drawn over them.
|
||||
*/
|
||||
tty_kitty_delete_all(&c->tty);
|
||||
#endif
|
||||
screen_redraw_draw_panes(&ctx);
|
||||
screen_redraw_draw_pane_scrollbars(&ctx);
|
||||
}
|
||||
@@ -697,8 +707,12 @@ screen_redraw_pane(struct client *c, struct window_pane *wp,
|
||||
tty_sync_start(&c->tty);
|
||||
tty_update_mode(&c->tty, c->tty.mode, NULL);
|
||||
|
||||
if (!redraw_scrollbar_only)
|
||||
if (!redraw_scrollbar_only) {
|
||||
#ifdef ENABLE_KITTY
|
||||
tty_kitty_delete_all(&c->tty);
|
||||
#endif
|
||||
screen_redraw_draw_pane(&ctx, wp);
|
||||
}
|
||||
|
||||
if (window_pane_show_scrollbar(wp, ctx.pane_scrollbars))
|
||||
screen_redraw_draw_pane_scrollbar(&ctx, wp);
|
||||
|
||||
Reference in New Issue
Block a user