Clean up image support and add regression tests

This commit is contained in:
Michael Grant
2026-10-04 11:44:00 +01:00
parent 91441d6ef2
commit 90ee6a89cc
31 changed files with 465 additions and 633 deletions

View File

@@ -3070,26 +3070,18 @@ format_cb_version(__unused struct format_tree *ft)
return (xstrdup(getversion()));
}
/* Callback for sixel_support. */
static void *
format_cb_sixel_support(__unused struct format_tree *ft)
{
#ifdef ENABLE_SIXEL
return (xstrdup("1"));
#else
return (xstrdup("0"));
#endif
}
/* Callback for image_support. */
static void *
format_cb_image_support(__unused struct format_tree *ft)
{
char *value;
#ifdef ENABLE_IMAGES
return (xstrdup("1"));
value = xstrdup("1");
#else
return (xstrdup("0"));
value = xstrdup("0");
#endif
return (value);
}
/* Callback for active_window_index. */
@@ -4104,7 +4096,7 @@ static const struct format_table_entry format_table[] = {
format_cb_session_windows
},
{ "sixel_support", FORMAT_TABLE_STRING,
format_cb_sixel_support
format_cb_image_support
},
{ "socket_path", FORMAT_TABLE_STRING,
format_cb_socket_path