From 782feb691bc15d1abd5f5c66fe3c0d336903a461 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 10 Oct 2024 10:41:33 +0000 Subject: [PATCH] Add a sixel_support format variable which is 1 if SIXEL is supported (always 0 on OpenBSD), requested by Misaki Masa in GitHub issue 4177 --- usr.bin/tmux/format.c | 12 +++++++++++- usr.bin/tmux/tmux.1 | 5 +++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 10283c597cd..a396491840b 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.320 2024/08/26 07:14:40 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.321 2024/10/10 10:41:33 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -2320,6 +2320,13 @@ 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) +{ + return (xstrdup("0")); +} + /* Callback for active_window_index. */ static void * format_cb_active_window_index(struct format_tree *ft) @@ -3147,6 +3154,9 @@ 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 + }, { "socket_path", FORMAT_TABLE_STRING, format_cb_socket_path }, diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index bd93f84663e..99e4f031119 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.964 2024/10/07 12:58:36 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.965 2024/10/10 10:41:33 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 7 2024 $ +.Dd $Mdocdate: October 10 2024 $ .Dt TMUX 1 .Os .Sh NAME @@ -5954,6 +5954,7 @@ 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 "uid" Ta "" Ta "Server UID" .It Li "user" Ta "" Ta "Server user" -- 2.20.1