Skip to content

Commit

Permalink
TerminalFont (macOS): fix ghostty font detection; default to `JetBrai…
Browse files Browse the repository at this point in the history
…ns Mono`

Ref: #1466 (comment)
  • Loading branch information
CarterLi committed Dec 30, 2024
1 parent 2a83b86 commit 2ab2dd4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/detection/terminalfont/terminalfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 2ab2dd4

Please sign in to comment.