TerminalShell (Linux): relax detection of terminals in NixOS

Fix #1479
This commit is contained in:
Carter Li 2025-01-03 10:18:05 +08:00
parent ea78665971
commit f973572c5a

View File

@ -313,11 +313,11 @@ static void setShellInfoDetails(FFShellResult* result)
static void setTerminalInfoDetails(FFTerminalResult* result)
{
if(ffStrbufStartsWithC(&result->processName, '.') && ffStrbufEndsWithS(&result->processName, "-wrapped"))
if(ffStrbufStartsWithC(&result->processName, '.') && ffStrbufContainS(&result->processName, "-wrap"))
{
// For NixOS. Ref: #510 and https://github.com/NixOS/nixpkgs/pull/249428
// We use processName when detecting version and font, overriding it for simplification
ffStrbufSubstrBefore(&result->processName, result->processName.length - (uint32_t) strlen("-wrapped"));
ffStrbufSubstrBeforeLastC(&result->processName, '-');
ffStrbufSubstrAfter(&result->processName, 0);
}