mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Terminal: support foot version detection
This commit is contained in:
@@ -188,6 +188,20 @@ FF_MAYBE_UNUSED static bool getTerminalVersionKonsole(FFstrbuf* exe, FFstrbuf* v
|
||||
return getExeVersionGeneral(exe, version);
|
||||
}
|
||||
|
||||
FF_MAYBE_UNUSED static bool getTerminalVersionFoot(FFstrbuf* exe, FFstrbuf* version)
|
||||
{
|
||||
if(ffProcessAppendStdOut(version, (char* const[]){
|
||||
exe->chars,
|
||||
"--version",
|
||||
NULL
|
||||
})) return false;
|
||||
|
||||
//foot version: 1.13.1 -pgo +ime -graphemes -assertions
|
||||
ffStrbufSubstrAfterFirstS(version, "version: ");
|
||||
ffStrbufSubstrBeforeFirstC(version, ' ');
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
static bool getTerminalVersionWindowsTerminal(FFstrbuf* exe, FFstrbuf* version)
|
||||
@@ -240,6 +254,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe
|
||||
if(ffStrbufIgnCaseEqualS(processName, "deepin-terminal"))
|
||||
return getExeVersionGeneral(exe, version);//deepin-terminal 5.4.36
|
||||
|
||||
if(ffStrbufIgnCaseEqualS(processName, "foot"))
|
||||
return getTerminalVersionFoot(exe, version);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user