mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
TerminalFont: fix mintty terminal font detection
This commit is contained in:
@@ -16,6 +16,7 @@ Logos:
|
||||
|
||||
Bugfixes:
|
||||
* `--logo-type` now does accept `iterm` too (@CarterLi, #374)
|
||||
* Fix mintty terminal font detection
|
||||
|
||||
Other:
|
||||
* Fixed a Typo in iterm error message (@jessebot, #376)
|
||||
|
||||
@@ -77,6 +77,30 @@ static void initConfigDirs(FFstate* state)
|
||||
ffStrbufEnsureEndsWithC(userHome, '/');
|
||||
FF_ENSURE_ONLY_ONCE_IN_LIST(userHome)
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
if(getenv("MSYSTEM") && getenv("HOME"))
|
||||
{
|
||||
// We are in MSYS2 / Git Bash
|
||||
|
||||
FFstrbuf* msysConfigHome = ffListAdd(&state->configDirs);
|
||||
ffStrbufInitA(msysConfigHome, 64);
|
||||
ffStrbufAppendS(msysConfigHome, getenv("HOME"));
|
||||
ffStrbufReplaceAllC(msysConfigHome, '\\', '/');
|
||||
ffStrbufEnsureEndsWithC(msysConfigHome, '/');
|
||||
ffStrbufAppendS(msysConfigHome, ".config/");
|
||||
FF_ENSURE_ONLY_ONCE_IN_LIST(msysConfigHome)
|
||||
|
||||
FFstrbuf* msysHome = ffListAdd(&state->configDirs);
|
||||
ffStrbufInitA(msysHome, 64);
|
||||
ffStrbufAppendS(msysHome, getenv("HOME"));
|
||||
ffStrbufReplaceAllC(msysHome, '\\', '/');
|
||||
ffStrbufEnsureEndsWithC(msysHome, '/');
|
||||
FF_ENSURE_ONLY_ONCE_IN_LIST(msysHome)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !(defined(_WIN32) || defined(__APPLE__) || defined(__ANDROID__))
|
||||
|
||||
FFstrbuf xdgConfigDirs;
|
||||
@@ -112,11 +136,15 @@ static void initConfigDirs(FFstate* state)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
FFstrbuf* systemConfig = ffListAdd(&state->configDirs);
|
||||
ffStrbufInitA(systemConfig, 64);
|
||||
ffStrbufAppendS(systemConfig, FASTFETCH_TARGET_DIR_ETC"/");
|
||||
FF_ENSURE_ONLY_ONCE_IN_LIST(systemConfig)
|
||||
|
||||
#endif
|
||||
|
||||
#undef FF_ENSURE_ONLY_ONCE_IN_LIST
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,14 @@ static void detectMintty(const FFinstance* instance, FFTerminalFontResult* termi
|
||||
FF_STRBUF_AUTO_DESTROY fontSize;
|
||||
ffStrbufInit(&fontSize);
|
||||
|
||||
ffParsePropFileHomeValues(instance, ".minttyrc", 2, (FFpropquery[]) {
|
||||
if(!ffParsePropFileConfigValues(instance, "mintty/config", 2, (FFpropquery[]) {
|
||||
{"Font=", &fontName},
|
||||
{"FontHeight=", &fontSize}
|
||||
});
|
||||
}))
|
||||
ffParsePropFileConfigValues(instance, ".minttyrc", 2, (FFpropquery[]) {
|
||||
{"Font=", &fontName},
|
||||
{"FontHeight=", &fontSize}
|
||||
});
|
||||
if(fontName.length == 0)
|
||||
ffStrbufAppendS(&fontName, "Lucida Console");
|
||||
if(fontSize.length == 0)
|
||||
|
||||
Reference in New Issue
Block a user