mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Terminal (macOS): fix compatibility with Fig
This commit is contained in:
@@ -172,6 +172,12 @@ static void getTerminalShell(FFTerminalShellResult* result, pid_t pid)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// https://github.com/fastfetch-cli/fastfetch/discussions/501
|
||||
if (ffStrEndsWith(name, " (figterm)"))
|
||||
getProcessNameAndPpid(ppid, name, &ppid);
|
||||
#endif
|
||||
|
||||
result->terminalPid = (uint32_t) pid;
|
||||
ffStrbufSetS(&result->terminalProcessName, name);
|
||||
getProcessInformation(pid, &result->terminalProcessName, &result->terminalExe, &result->terminalExeName);
|
||||
|
||||
@@ -25,6 +25,15 @@ static inline bool ffStrStartsWith(const char* str, const char* compareTo)
|
||||
return strncmp(str, compareTo, strlen(compareTo)) == 0;
|
||||
}
|
||||
|
||||
static inline bool ffStrEndsWith(const char* str, const char* compareTo)
|
||||
{
|
||||
size_t strLength = strlen(str);
|
||||
size_t compareToLength = strlen(compareTo);
|
||||
if (strLength < compareToLength)
|
||||
return false;
|
||||
return memcmp(str + strLength - compareToLength, compareTo, compareToLength) == 0;
|
||||
}
|
||||
|
||||
static inline bool ffStrEquals(const char* str, const char* compareTo)
|
||||
{
|
||||
return strcmp(str, compareTo) == 0;
|
||||
|
||||
Reference in New Issue
Block a user