From 041b2dd29d30a8ecadca22ef25282cbad672d94e Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Fri, 18 Sep 2026 09:56:10 +0200 Subject: Show tui and server versions in the status line; derive version from git - build: VERSION defaults to git describe, deploy passes the tag via --build-arg - bokftui: srv version from meta, right-aligned next to the status line --- clients/bokftui.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'clients/bokftui.c') diff --git a/clients/bokftui.c b/clients/bokftui.c index 5daa606..a7bbf7c 100644 --- a/clients/bokftui.c +++ b/clients/bokftui.c @@ -134,6 +134,9 @@ static int jbool_val(const char *resp, const char *path, int def) /* ------------------------------------------------------------------ */ static char g_status[512]; +static char g_server_version[32]; + +static int disp_width(const char *s); static void show_error(const char *title, const char *resp); static int64_t vouchers_new(struct app *a); @@ -415,6 +418,15 @@ static void frame(const char *title) if (g_status[0]) { attron(A_DIM); mvaddnstr(1, 2, g_status, COLS - 4); + char ver[96]; + if (g_server_version[0]) + snprintf(ver, sizeof ver, "tui %s srv %s", BOKF_VERSION, + g_server_version); + else + snprintf(ver, sizeof ver, "tui %s", BOKF_VERSION); + int x = COLS - 3 - disp_width(ver); + if (x > disp_width(g_status) + 6) + mvaddstr(1, x, ver); attroff(A_DIM); } } @@ -956,6 +968,10 @@ static void app_refresh_context(struct app *a) a->max_attachment_bytes = 10 * 1024 * 1024; resp = client_rpc(&a->conn, "meta", NULL, 0, NULL); if (resp && client_ok(resp)) { + char *ver = jstr_dup(resp, "result.version"); + if (ver && *ver) + snprintf(g_server_version, sizeof g_server_version, "%s", ver); + free(ver); int64_t v = jint_val(resp, "result.limits.max_attachment_bytes", 0); if (v > 0) -- cgit v1.3