Terminal: Support sakura version & font detection

Fix #1424
This commit is contained in:
Carter Li committed 2024-12-02 19:10:47 +08:00
1 parent dfe36daf79
commit ab200d7e4a
3 files changed
+19

No files matched your search

@@ -661,6 +661,19 @@ FF_MAYBE_UNUSED static bool getTerminalVersionTilix(FFstrbuf* exe, FFstrbuf* ver
ffStrbufSubstrAfter(version, index);
return true;
}
FF_MAYBE_UNUSED static bool getTerminalVersionSakura(FFstrbuf* exe, FFstrbuf* version)
{
if(ffProcessAppendStdErr(version, (char* const[]) {
exe->chars,
"--version",
NULL
}) != NULL) // sakura version is 3.8.8
return false;
ffStrbufSubstrAfterLastC(version, ' ');
return true;
}
#endif
#ifdef _WIN32
@@ -763,6 +776,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
if(ffStrbufIgnCaseEqualS(processName, "tilix"))
return getTerminalVersionTilix(exe, version);
if(ffStrbufIgnCaseEqualS(processName, "sakura"))
return getTerminalVersionSakura(exe, version);
#endif
#ifdef _WIN32