From 5a233e26ec723b3244ef0e49dbac31eada7b63d4 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Mon, 2 Mar 2026 17:07:07 +0000 Subject: [PATCH] rename ENABLE_KITTY to ENABLE_KITTY_IMAGES --- Makefile.am | 2 +- configure.ac | 10 +++++----- format.c | 5 ++--- input.c | 8 ++++---- screen-redraw.c | 4 ++-- tmux.h | 8 ++++---- tty-features.c | 2 +- tty-keys.c | 8 ++++---- tty.c | 4 ++-- 9 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Makefile.am b/Makefile.am index d824f30b..9f424d7b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -237,7 +237,7 @@ dist_tmux_SOURCES += image.c image-sixel.c endif # Enable kitty graphics protocol support. -if ENABLE_KITTY +if ENABLE_KITTY_IMAGES dist_tmux_SOURCES += image-kitty.c endif diff --git a/configure.ac b/configure.ac index ad6bf614..b91126ae 100644 --- a/configure.ac +++ b/configure.ac @@ -483,13 +483,13 @@ AM_CONDITIONAL(ENABLE_SIXEL, [test "x$enable_sixel_images" = xyes]) # Enable kitty graphics protocol support. AC_ARG_ENABLE( - kitty, - AS_HELP_STRING(--enable-kitty, enable kitty terminal graphics protocol) + kitty-images, + AS_HELP_STRING(--enable-kitty-images, enable kitty terminal graphics) ) -if test "x$enable_kitty" = xyes; then - AC_DEFINE(ENABLE_KITTY) +if test "x$enable_kitty_images" = xyes; then + AC_DEFINE(ENABLE_KITTY_IMAGES) 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. AC_MSG_CHECKING(for b64_ntop) diff --git a/format.c b/format.c index b28904c8..a0819a68 100644 --- a/format.c +++ b/format.c @@ -2564,7 +2564,7 @@ format_cb_version(__unused struct format_tree *ft) static void * 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")); #endif @@ -2572,11 +2572,10 @@ format_cb_image_support(__unused struct format_tree *ft) return (xstrdup("sixel")); #endif -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES return (xstrdup("kitty")); #endif return (NULL); - } /* Callback for active_window_index. */ diff --git a/input.c b/input.c index d3dd6f04..a32d2bab 100644 --- a/input.c +++ b/input.c @@ -1382,7 +1382,7 @@ input_esc_dispatch(struct input_ctx *ictx) input_reset_cell(ictx); screen_write_reset(sctx); screen_write_fullredraw(sctx); -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES if (ictx->wp != NULL) tty_kitty_delete_all_pane(ictx->wp); #endif @@ -2727,7 +2727,7 @@ input_exit_apc(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; struct window_pane *wp = ictx->wp; -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES struct kitty_image *ki; #endif @@ -2735,7 +2735,7 @@ input_exit_apc(struct input_ctx *ictx) return; 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 (wp == NULL) return; @@ -2784,7 +2784,7 @@ input_exit_apc(struct input_ctx *ictx) } return; } -#endif /* ENABLE_KITTY */ +#endif /* ENABLE_KITTY_IMAGES */ if (wp != NULL && options_get_number(wp->options, "allow-set-title") && diff --git a/screen-redraw.c b/screen-redraw.c index 073b73a3..380861fd 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -667,7 +667,7 @@ screen_redraw_screen(struct client *c) } if (flags & CLIENT_REDRAWWINDOW) { log_debug("%s: redrawing panes", c->name); -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES /* * Delete all kitty image placements before redrawing panes. * 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); if (!redraw_scrollbar_only) { -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES tty_kitty_delete_all(&c->tty); #endif screen_redraw_draw_pane(&ctx, wp); diff --git a/tmux.h b/tmux.h index 07dce198..1619128e 100644 --- a/tmux.h +++ b/tmux.h @@ -72,7 +72,7 @@ struct session; struct sixel_image; #endif -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES struct kitty_image; #endif @@ -948,7 +948,7 @@ struct image { TAILQ_HEAD(images, image); #endif -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES /* * 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 @@ -2702,7 +2702,7 @@ void tty_cmd_rawstring(struct tty *, const struct tty_ctx *); void tty_cmd_sixelimage(struct tty *, const struct tty_ctx *); #endif -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES void tty_kitty_delete_all(struct tty *); void tty_kitty_delete_all_pane(struct window_pane *); 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 *); #endif -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES /* image-kitty.c */ struct kitty_image *kitty_parse(const u_char *, size_t, u_int, u_int); void kitty_free(struct kitty_image *); diff --git a/tty-features.c b/tty-features.c index 586139e2..1c6ce4d2 100644 --- a/tty-features.c +++ b/tty-features.c @@ -513,7 +513,7 @@ tty_default_features(int *feat, const char *name, u_int version) .features = TTY_FEATURES_BASE_MODERN_XTERM ",ccolour,cstyle,extkeys,focus" }, -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES { .name = "kitty", .features = TTY_FEATURES_BASE_MODERN_XTERM ",ccolour,cstyle,extkeys,focus,sync,hyperlinks" diff --git a/tty-keys.c b/tty-keys.c index e265005c..7dbf70b9 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -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 *, 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, size_t *); #endif @@ -763,7 +763,7 @@ tty_keys_next(struct tty *tty) goto partial_key; } -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES /* Is this a kitty graphics protocol response? ESC _ G ... ESC \ */ switch (tty_keys_kitty_graphics(tty, buf, len, &size)) { case 0: /* yes */ @@ -1657,7 +1657,7 @@ tty_keys_extended_device_attributes(struct tty *tty, const char *buf, tty_default_features(features, "mintty", 0); else if (strncmp(tmp, "foot(", 5) == 0) tty_default_features(features, "foot", 0); -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES else if (strncmp(tmp, "kitty ", 6) == 0 || strcmp(tmp, "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); } -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES /* * Handle kitty graphics protocol response from outer terminal. * Format: ESC _ G ; ESC \ diff --git a/tty.c b/tty.c index 6e013a2c..49e8e684 100644 --- a/tty.c +++ b/tty.c @@ -391,7 +391,7 @@ tty_send_requests(struct tty *tty) return; if (tty->term->flags & TERM_VT100LIKE) { -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES /* * Send the kitty graphics capability probe BEFORE the DA1 * 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 -#ifdef ENABLE_KITTY +#ifdef ENABLE_KITTY_IMAGES static int tty_has_kitty(struct tty *tty) {