From 2ab2dd4d4880191e5bdd6b6236f7e85518c789b3 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Mon, 30 Dec 2024 00:04:09 +0800 Subject: [PATCH] TerminalFont (macOS): fix ghostty font detection; default to `JetBrains Mono` Ref: https://github.com/fastfetch-cli/fastfetch/issues/1466#issuecomment-2564379883 --- src/detection/terminalfont/terminalfont.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/detection/terminalfont/terminalfont.c b/src/detection/terminalfont/terminalfont.c index be2d75d80..005c3f32b 100644 --- a/src/detection/terminalfont/terminalfont.c +++ b/src/detection/terminalfont/terminalfont.c @@ -58,14 +58,18 @@ static void detectGhostty(FFTerminalFontResult* terminalFont) {"font-size =", &fontSize}, }; - if (!ffParsePropFileConfigValues("ghostty/config", 2, fontQueryToml)) - { + if ( + #if __APPLE__ + !ffParsePropFileConfigValues("com.mitchellh.ghostty/config", 2, fontQueryToml) && + #endif + !ffParsePropFileConfigValues("ghostty/config", 2, fontQueryToml) + ) { ffStrbufAppendS(&terminalFont->error, "Couldn't find file `ghostty/config`"); return; } if(fontName.length == 0) - ffStrbufAppendS(&fontName, "monospace"); + ffStrbufAppendS(&fontName, "JetBrains Mono"); if(fontSize.length == 0) ffStrbufAppendS(&fontSize, "13");