From 6ef7375adebaf3276a947937ff6ad75af21b24b9 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 4 Jan 2026 08:05:14 +0000 Subject: [PATCH] Add some missing logging bits for themes. --- input.c | 7 ++++++- key-string.c | 8 ++++++++ screen.c | 2 ++ window.c | 5 +++-- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/input.c b/input.c index b3f67b23..0fd02dce 100644 --- a/input.c +++ b/input.c @@ -3395,14 +3395,19 @@ input_cancel_requests(struct client *c) static void input_report_current_theme(struct input_ctx *ictx) { - switch (window_pane_get_theme(ictx->wp)) { + struct window_pane *wp = ictx->wp; + + switch (window_pane_get_theme(wp)) { case THEME_DARK: + log_debug("%s: %%%u dark theme", __func__, wp->id); input_reply(ictx, 0, "\033[?997;1n"); break; case THEME_LIGHT: + log_debug("%s: %%%u light theme", __func__, wp->id); input_reply(ictx, 0, "\033[?997;2n"); break; case THEME_UNKNOWN: + log_debug("%s: %%%u unknown theme", __func__, wp->id); break; } } diff --git a/key-string.c b/key-string.c index a171b0cb..8b9b5604 100644 --- a/key-string.c +++ b/key-string.c @@ -382,6 +382,14 @@ key_string_lookup_key(key_code key, int with_flags) s = "PasteEnd"; goto append; } + if (key == KEYC_REPORT_DARK_THEME) { + s = "ReportDarkTheme"; + goto append; + } + if (key == KEYC_REPORT_LIGHT_THEME) { + s = "ReportLightTheme"; + goto append; + } if (key == KEYC_MOUSE) { s = "Mouse"; goto append; diff --git a/screen.c b/screen.c index 2b73cbce..12a55097 100644 --- a/screen.c +++ b/screen.c @@ -739,6 +739,8 @@ screen_mode_to_string(int mode) strlcat(tmp, "KEYS_EXTENDED,", sizeof tmp); if (mode & MODE_KEYS_EXTENDED_2) strlcat(tmp, "KEYS_EXTENDED_2,", sizeof tmp); + if (mode & MODE_THEME_UPDATES) + strlcat(tmp, "THEME_UPDATES,", sizeof tmp); tmp[strlen(tmp) - 1] = '\0'; return (tmp); } diff --git a/window.c b/window.c index 24bc5936..f3b8b8a8 100644 --- a/window.c +++ b/window.c @@ -1932,17 +1932,18 @@ window_pane_send_theme_update(struct window_pane *wp) return; if (~wp->screen->mode & MODE_THEME_UPDATES) return; - switch (window_pane_get_theme(wp)) { case THEME_LIGHT: + log_debug("%s: %%%u light theme", __func__, wp->id); input_key_pane(wp, KEYC_REPORT_LIGHT_THEME, NULL); break; case THEME_DARK: + log_debug("%s: %%%u dark theme", __func__, wp->id); input_key_pane(wp, KEYC_REPORT_DARK_THEME, NULL); break; case THEME_UNKNOWN: + log_debug("%s: %%%u unknown theme", __func__, wp->id); break; } - wp->flags &= ~PANE_THEMECHANGED; }