diff --git a/format.c b/format.c index 5bbabd08..b28904c8 100644 --- a/format.c +++ b/format.c @@ -2562,24 +2562,21 @@ format_cb_version(__unused struct format_tree *ft) /* Callback for sixel_support. */ static void * -format_cb_sixel_support(__unused struct format_tree *ft) +format_cb_image_support(__unused struct format_tree *ft) { -#ifdef ENABLE_SIXEL - return (xstrdup("1")); -#else - return (xstrdup("0")); +#if defined(ENABLE_SIXEL) && defined(ENABLE_KITTY) + return (xstrdup("kitty,sixel")); #endif -} -/* Callback for kitty_support. */ -static void * -format_cb_kitty_support(__unused struct format_tree *ft) -{ -#ifdef ENABLE_KITTY - return (xstrdup("1")); -#else - return (xstrdup("0")); +#ifdef ENABLE_SIXEL + return (xstrdup("sixel")); #endif + +#ifdef ENABLE_KITTY + return (xstrdup("kitty")); +#endif + return (NULL); + } /* Callback for active_window_index. */ @@ -3201,6 +3198,9 @@ static const struct format_table_entry format_table[] = { { "host_short", FORMAT_TABLE_STRING, format_cb_host_short }, + { "image_support", FORMAT_TABLE_STRING, + format_cb_image_support + }, { "insert_flag", FORMAT_TABLE_STRING, format_cb_insert_flag }, @@ -3477,12 +3477,6 @@ static const struct format_table_entry format_table[] = { { "session_windows", FORMAT_TABLE_STRING, format_cb_session_windows }, - { "sixel_support", FORMAT_TABLE_STRING, - format_cb_sixel_support - }, - { "kitty_support", FORMAT_TABLE_STRING, - format_cb_kitty_support - }, { "socket_path", FORMAT_TABLE_STRING, format_cb_socket_path }, diff --git a/tmux.1 b/tmux.1 index 6ee8dd93..19d4060a 100644 --- a/tmux.1 +++ b/tmux.1 @@ -6266,6 +6266,7 @@ The following variables are available, where appropriate: .It Li "hook_window_name" Ta "" Ta "Name of window where hook was run, if any" .It Li "host" Ta "#H" Ta "Hostname of local host" .It Li "host_short" Ta "#h" Ta "Hostname of local host (no domain name)" +.It Li "image_support" Ta "" Ta "Returns the string of the support image (sixel, kitty)" .It Li "insert_flag" Ta "" Ta "Pane insert flag" .It Li "key_string" Ta "" Ta "String representation of the key binding" .It Li "key_repeat" Ta "" Ta "1 if key binding is repeatable" @@ -6380,7 +6381,6 @@ The following variables are available, where appropriate: .It Li "session_stack" Ta "" Ta "Window indexes in most recent order" .It Li "session_windows" Ta "" Ta "Number of windows in session" .It Li "socket_path" Ta "" Ta "Server socket path" -.It Li "sixel_support" Ta "" Ta "1 if server has support for SIXEL" .It Li "start_time" Ta "" Ta "Server start time" .It Li "synchronized_output_flag" Ta "" Ta "1 if pane has synchronized output enabled" .It Li "uid" Ta "" Ta "Server UID"