From c2792a181127fbb5dbdf2f71e3132f1ff45805fc Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 27 Dec 2024 08:56:57 -0600 Subject: [PATCH] cli(list_themes): ignore .DS_Store macOS will create `.DS_Store` files in any directory it opens in Finder. The `+list_themes` command would then list this file as a theme, and attempt to preview it. `.DS_Store` is a binary file, and is silently failing in the theme preview...I am on Linux and when I put a small binary file in my user themes directory, I get a segfault. There is something about the specific contents in `.DS_Store` that does not cause this segfault, but lets us silently fail. We should investigate this further - the issue is in `Config.loadFile` I believe. In either case, we need to ignore `.DS_Store` so that it is not listed as a theme. Fixes: #3378 --- src/cli/list_themes.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cli/list_themes.zig b/src/cli/list_themes.zig index a8cc7b21c..fa6e86d89 100644 --- a/src/cli/list_themes.zig +++ b/src/cli/list_themes.zig @@ -127,6 +127,8 @@ pub fn run(gpa_alloc: std.mem.Allocator) !u8 { while (try walker.next()) |entry| { switch (entry.kind) { .file, .sym_link => { + if (std.mem.eql(u8, entry.name, ".DS_Store")) + continue; count += 1; try themes.append(.{ .location = loc.location,