From 939c369aee270067d9f030e2b234d93bae549988 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 19:26:12 -0300 Subject: After a ThemeFile, the root ctl and DumpConfig say ThemeFile and its path, so what they report writes back Both said Theme and the name inside the .zon, which no Theme knows, so writing the report back to /ctl failed with "no theme". While a loaded ThemeFile is the theme in effect they now say the word that loaded it. A Dump carries the line too, so a Restore reloads the file. Co-Authored-By: Claude Opus 5.5 --- src/colors.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/colors.zig') diff --git a/src/colors.zig b/src/colors.zig index c78043cc..8d541c13 100644 --- a/src/colors.zig +++ b/src/colors.zig @@ -735,6 +735,14 @@ pub fn requestThemeFile(p: *Pardes, id: usize, argument: []const u8) void { p.emit(.{ .theme_file = .{ .generation = generation, .on = true } }); } +/// The .zon a ThemeFile loaded, while it is the theme in effect: what +/// /ctl and DumpConfig say in place of `Theme `, since the name +/// inside the file is no theme `Theme` knows. +pub fn loadedThemeFile(p: *const Pardes) ?[]const u8 { + const path = p.theme_file_path.get(); + return if (p.custom_theme != null and path.len > 0) path else null; +} + pub const ThemeFileRequest = struct { path: []const u8, pane: u8, -- cgit v1.3