From 373e80c8ffbd3ad8da84bd794aadaa7b3d394c77 Mon Sep 17 00:00:00 2001 From: Matthew Glazar Date: Sun, 22 Jun 2025 18:43:28 -0400 Subject: [PATCH] fix(tui): don't use path/filepath for embed EmbedFS uses '/' always for file paths. It does not support '\' even on Windows. Make sure we don't give EmbedFS a '\' path on Windows. This lets the TUI find the theme files, avoiding crashes in various parts of the code that assume a theme exists. --- packages/tui/internal/theme/loader.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/tui/internal/theme/loader.go b/packages/tui/internal/theme/loader.go index 424dc5f5..7df46b7f 100644 --- a/packages/tui/internal/theme/loader.go +++ b/packages/tui/internal/theme/loader.go @@ -6,6 +6,7 @@ import ( "fmt" "image/color" "os" + "path" "path/filepath" "strings" @@ -42,7 +43,7 @@ func LoadThemesFromJSON() error { continue } themeName := strings.TrimSuffix(entry.Name(), ".json") - data, err := themesFS.ReadFile(filepath.Join("themes", entry.Name())) + data, err := themesFS.ReadFile(path.Join("themes", entry.Name())) if err != nil { return fmt.Errorf("failed to read theme file %s: %w", entry.Name(), err) }