Terminal / Shell: fix name printing

This commit is contained in:
李通洲
2022-10-09 16:51:53 +08:00
parent 7c98450acc
commit 034f444fca
5 changed files with 30 additions and 13 deletions
@@ -322,6 +322,14 @@ const FFTerminalShellResult*
else
ffStrbufSet(&result.userShellVersion, &result.shellVersion);
// https://github.com/LinusDierheimer/fastfetch/discussions/280#discussioncomment-3831734
ffStrbufInitS(&result.shellPrettyName, result.shellExeName);
if(strncmp(result.terminalExeName, result.terminalProcessName.chars, result.terminalProcessName.length) == 0) // if exeName starts with processName, print it. Otherwise print processName
ffStrbufInitS(&result.terminalPrettyName, result.terminalExeName);
else
ffStrbufInitCopy(&result.terminalPrettyName, &result.terminalProcessName);
pthread_mutex_unlock(&mutex);
return &result;
}