TerminalShell: detect first shell we found only.

Previously we always detect login shell as current shell, which seems duplicate with userShell
This commit is contained in:
李通洲
2022-10-14 18:31:17 +08:00
parent 3b541d3670
commit 220a7d24bc
@@ -138,8 +138,11 @@ static void getTerminalShell(FFTerminalShellResult* result, pid_t pid)
strcasecmp(name, "nu") == 0 ||
strcasecmp(name, "git-shell") == 0
) {
ffStrbufSetS(&result->shellProcessName, name); // prevent from `fishbash`
getProcessInformation(pid, &result->shellProcessName, &result->shellExe, &result->shellExeName);
if (result->shellProcessName.length == 0)
{
ffStrbufSetS(&result->shellProcessName, name);
getProcessInformation(pid, &result->shellProcessName, &result->shellExe, &result->shellExeName);
}
getTerminalShell(result, ppid);
return;