mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 07:45:35 +00:00
rename ENABLE_KITTY to ENABLE_KITTY_IMAGES
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
10
configure.ac
10
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)
|
||||
|
||||
5
format.c
5
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. */
|
||||
|
||||
8
input.c
8
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") &&
|
||||
|
||||
@@ -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);
|
||||
|
||||
8
tmux.h
8
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 *);
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 <key=value,...> ; <message> ESC \
|
||||
|
||||
4
tty.c
4
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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user