rename ENABLE_KITTY to ENABLE_KITTY_IMAGES

This commit is contained in:
Thomas Adam
2026-03-02 17:07:07 +00:00
parent 1634db8589
commit 5a233e26ec
9 changed files with 25 additions and 26 deletions

View File

@@ -237,7 +237,7 @@ dist_tmux_SOURCES += image.c image-sixel.c
endif endif
# Enable kitty graphics protocol support. # Enable kitty graphics protocol support.
if ENABLE_KITTY if ENABLE_KITTY_IMAGES
dist_tmux_SOURCES += image-kitty.c dist_tmux_SOURCES += image-kitty.c
endif endif

View File

@@ -483,13 +483,13 @@ AM_CONDITIONAL(ENABLE_SIXEL, [test "x$enable_sixel_images" = xyes])
# Enable kitty graphics protocol support. # Enable kitty graphics protocol support.
AC_ARG_ENABLE( AC_ARG_ENABLE(
kitty, kitty-images,
AS_HELP_STRING(--enable-kitty, enable kitty terminal graphics protocol) AS_HELP_STRING(--enable-kitty-images, enable kitty terminal graphics)
) )
if test "x$enable_kitty" = xyes; then if test "x$enable_kitty_images" = xyes; then
AC_DEFINE(ENABLE_KITTY) AC_DEFINE(ENABLE_KITTY_IMAGES)
fi fi
AM_CONDITIONAL(ENABLE_KITTY, [test "x$enable_kitty" = xyes]) AM_CONDITIONAL(ENABLE_KITTY_IMAGES, [test "x$enable_kitty_images" = xyes])
# Check for b64_ntop. If we have b64_ntop, we assume b64_pton as well. # Check for b64_ntop. If we have b64_ntop, we assume b64_pton as well.
AC_MSG_CHECKING(for b64_ntop) AC_MSG_CHECKING(for b64_ntop)

View File

@@ -2564,7 +2564,7 @@ format_cb_version(__unused struct format_tree *ft)
static void * static void *
format_cb_image_support(__unused struct format_tree *ft) format_cb_image_support(__unused struct format_tree *ft)
{ {
#if defined(ENABLE_SIXEL) && defined(ENABLE_KITTY) #if defined(ENABLE_SIXEL) && defined(ENABLE_KITTY_IMAGES)
return (xstrdup("kitty,sixel")); return (xstrdup("kitty,sixel"));
#endif #endif
@@ -2572,11 +2572,10 @@ format_cb_image_support(__unused struct format_tree *ft)
return (xstrdup("sixel")); return (xstrdup("sixel"));
#endif #endif
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
return (xstrdup("kitty")); return (xstrdup("kitty"));
#endif #endif
return (NULL); return (NULL);
} }
/* Callback for active_window_index. */ /* Callback for active_window_index. */

View File

@@ -1382,7 +1382,7 @@ input_esc_dispatch(struct input_ctx *ictx)
input_reset_cell(ictx); input_reset_cell(ictx);
screen_write_reset(sctx); screen_write_reset(sctx);
screen_write_fullredraw(sctx); screen_write_fullredraw(sctx);
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
if (ictx->wp != NULL) if (ictx->wp != NULL)
tty_kitty_delete_all_pane(ictx->wp); tty_kitty_delete_all_pane(ictx->wp);
#endif #endif
@@ -2727,7 +2727,7 @@ input_exit_apc(struct input_ctx *ictx)
{ {
struct screen_write_ctx *sctx = &ictx->ctx; struct screen_write_ctx *sctx = &ictx->ctx;
struct window_pane *wp = ictx->wp; struct window_pane *wp = ictx->wp;
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
struct kitty_image *ki; struct kitty_image *ki;
#endif #endif
@@ -2735,7 +2735,7 @@ input_exit_apc(struct input_ctx *ictx)
return; return;
log_debug("%s: \"%s\"", __func__, ictx->input_buf); log_debug("%s: \"%s\"", __func__, ictx->input_buf);
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
if (ictx->input_len >= 1 && ictx->input_buf[0] == 'G') { if (ictx->input_len >= 1 && ictx->input_buf[0] == 'G') {
if (wp == NULL) if (wp == NULL)
return; return;
@@ -2784,7 +2784,7 @@ input_exit_apc(struct input_ctx *ictx)
} }
return; return;
} }
#endif /* ENABLE_KITTY */ #endif /* ENABLE_KITTY_IMAGES */
if (wp != NULL && if (wp != NULL &&
options_get_number(wp->options, "allow-set-title") && options_get_number(wp->options, "allow-set-title") &&

View File

@@ -667,7 +667,7 @@ screen_redraw_screen(struct client *c)
} }
if (flags & CLIENT_REDRAWWINDOW) { if (flags & CLIENT_REDRAWWINDOW) {
log_debug("%s: redrawing panes", c->name); log_debug("%s: redrawing panes", c->name);
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
/* /*
* Delete all kitty image placements before redrawing panes. * Delete all kitty image placements before redrawing panes.
* This must happen unconditionally — even when the new window * This must happen unconditionally — even when the new window
@@ -708,7 +708,7 @@ screen_redraw_pane(struct client *c, struct window_pane *wp,
tty_update_mode(&c->tty, c->tty.mode, NULL); tty_update_mode(&c->tty, c->tty.mode, NULL);
if (!redraw_scrollbar_only) { if (!redraw_scrollbar_only) {
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
tty_kitty_delete_all(&c->tty); tty_kitty_delete_all(&c->tty);
#endif #endif
screen_redraw_draw_pane(&ctx, wp); screen_redraw_draw_pane(&ctx, wp);

8
tmux.h
View File

@@ -72,7 +72,7 @@ struct session;
struct sixel_image; struct sixel_image;
#endif #endif
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
struct kitty_image; struct kitty_image;
#endif #endif
@@ -948,7 +948,7 @@ struct image {
TAILQ_HEAD(images, image); TAILQ_HEAD(images, image);
#endif #endif
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
/* /*
* kitty_image stores the raw decoded pixel data and metadata from a kitty * kitty_image stores the raw decoded pixel data and metadata from a kitty
* graphics protocol APC sequence. It is used to re-emit the sequence to the * graphics protocol APC sequence. It is used to re-emit the sequence to the
@@ -2702,7 +2702,7 @@ void tty_cmd_rawstring(struct tty *, const struct tty_ctx *);
void tty_cmd_sixelimage(struct tty *, const struct tty_ctx *); void tty_cmd_sixelimage(struct tty *, const struct tty_ctx *);
#endif #endif
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
void tty_kitty_delete_all(struct tty *); void tty_kitty_delete_all(struct tty *);
void tty_kitty_delete_all_pane(struct window_pane *); void tty_kitty_delete_all_pane(struct window_pane *);
void tty_kitty_passthrough(struct window_pane *, const char *, size_t, void tty_kitty_passthrough(struct window_pane *, const char *, size_t,
@@ -3800,7 +3800,7 @@ char *sixel_print(struct sixel_image *, struct sixel_image *,
struct screen *sixel_to_screen(struct sixel_image *); struct screen *sixel_to_screen(struct sixel_image *);
#endif #endif
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
/* image-kitty.c */ /* image-kitty.c */
struct kitty_image *kitty_parse(const u_char *, size_t, u_int, u_int); struct kitty_image *kitty_parse(const u_char *, size_t, u_int, u_int);
void kitty_free(struct kitty_image *); void kitty_free(struct kitty_image *);

View File

@@ -513,7 +513,7 @@ tty_default_features(int *feat, const char *name, u_int version)
.features = TTY_FEATURES_BASE_MODERN_XTERM .features = TTY_FEATURES_BASE_MODERN_XTERM
",ccolour,cstyle,extkeys,focus" ",ccolour,cstyle,extkeys,focus"
}, },
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
{ .name = "kitty", { .name = "kitty",
.features = TTY_FEATURES_BASE_MODERN_XTERM .features = TTY_FEATURES_BASE_MODERN_XTERM
",ccolour,cstyle,extkeys,focus,sync,hyperlinks" ",ccolour,cstyle,extkeys,focus,sync,hyperlinks"

View File

@@ -60,7 +60,7 @@ static int tty_keys_device_attributes2(struct tty *, const char *, size_t,
static int tty_keys_extended_device_attributes(struct tty *, const char *, static int tty_keys_extended_device_attributes(struct tty *, const char *,
size_t, size_t *); size_t, size_t *);
static int tty_keys_palette(struct tty *, const char *, size_t, size_t *); static int tty_keys_palette(struct tty *, const char *, size_t, size_t *);
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
static int tty_keys_kitty_graphics(struct tty *, const char *, size_t, static int tty_keys_kitty_graphics(struct tty *, const char *, size_t,
size_t *); size_t *);
#endif #endif
@@ -763,7 +763,7 @@ tty_keys_next(struct tty *tty)
goto partial_key; goto partial_key;
} }
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
/* Is this a kitty graphics protocol response? ESC _ G ... ESC \ */ /* Is this a kitty graphics protocol response? ESC _ G ... ESC \ */
switch (tty_keys_kitty_graphics(tty, buf, len, &size)) { switch (tty_keys_kitty_graphics(tty, buf, len, &size)) {
case 0: /* yes */ case 0: /* yes */
@@ -1657,7 +1657,7 @@ tty_keys_extended_device_attributes(struct tty *tty, const char *buf,
tty_default_features(features, "mintty", 0); tty_default_features(features, "mintty", 0);
else if (strncmp(tmp, "foot(", 5) == 0) else if (strncmp(tmp, "foot(", 5) == 0)
tty_default_features(features, "foot", 0); tty_default_features(features, "foot", 0);
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
else if (strncmp(tmp, "kitty ", 6) == 0 || else if (strncmp(tmp, "kitty ", 6) == 0 ||
strcmp(tmp, "kitty") == 0) strcmp(tmp, "kitty") == 0)
tty_default_features(features, "kitty", 0); tty_default_features(features, "kitty", 0);
@@ -1821,7 +1821,7 @@ tty_keys_palette(struct tty *tty, const char *buf, size_t len, size_t *size)
return (0); return (0);
} }
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
/* /*
* Handle kitty graphics protocol response from outer terminal. * Handle kitty graphics protocol response from outer terminal.
* Format: ESC _ G <key=value,...> ; <message> ESC \ * Format: ESC _ G <key=value,...> ; <message> ESC \

4
tty.c
View File

@@ -391,7 +391,7 @@ tty_send_requests(struct tty *tty)
return; return;
if (tty->term->flags & TERM_VT100LIKE) { if (tty->term->flags & TERM_VT100LIKE) {
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
/* /*
* Send the kitty graphics capability probe BEFORE the DA1 * Send the kitty graphics capability probe BEFORE the DA1
* request. Per the kitty spec, a supporting terminal sends * request. Per the kitty spec, a supporting terminal sends
@@ -2165,7 +2165,7 @@ tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx)
} }
#endif #endif
#ifdef ENABLE_KITTY #ifdef ENABLE_KITTY_IMAGES
static int static int
tty_has_kitty(struct tty *tty) tty_has_kitty(struct tty *tty)
{ {