mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Terminal (macOS): fix compatibility with (*term) (#909)
Ignore <shell> (<char>term). This is because Fig(<shell> (figterm)) migrated to CodeWhisperer(<shell> (cwterm)) and CodeWhisperer renamed to Q(<shell> (qterm)). Future changes will all be ignored by this change. Related: #676
This commit is contained in:
@@ -307,10 +307,19 @@ static pid_t getTerminalInfo(FFTerminalResult* result, pid_t pid)
|
||||
|
||||
#ifdef __APPLE__
|
||||
// https://github.com/fastfetch-cli/fastfetch/discussions/501
|
||||
if (ffStrEndsWith(name, " (figterm)") || ffStrEndsWith(name, " (cwterm)"))
|
||||
const char* pLeft = strstr(name, " (");
|
||||
if (pLeft)
|
||||
{
|
||||
if (__builtin_expect(getProcessNameAndPpid(ppid, name, &ppid, NULL) != NULL, false))
|
||||
return 0;
|
||||
pLeft += 2;
|
||||
const char* pRight = strstr(pLeft, "term)");
|
||||
if (pRight && pRight[5] == '\0')
|
||||
{
|
||||
for (; pLeft < pRight; ++pLeft)
|
||||
if (*pLeft < 'a' || *pLeft > 'z')
|
||||
break;
|
||||
if (pLeft == pRight && getProcessNameAndPpid(ppid, name, &ppid, NULL) != NULL)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user