diff --git a/src/detection/terminalfont/terminalfont_windows.c b/src/detection/terminalfont/terminalfont_windows.c index 704efa5d5..e461986dd 100644 --- a/src/detection/terminalfont/terminalfont_windows.c +++ b/src/detection/terminalfont/terminalfont_windows.c @@ -91,6 +91,6 @@ void ffDetectTerminalFontPlatform(const FFTerminalShellResult* terminalShell, FF detectMintty(terminalFont); else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "conhost.exe") == 0) detectConhost(terminalFont); - else if(ffStrbufStartsWithIgnCaseS(&terminalShell->terminalProcessName, "ConEmuC")) + else if(ffStrbufStartsWithIgnCaseS(&terminalShell->terminalProcessName, "ConEmu")) detectConEmu(terminalFont); } diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index ad540e666..b5261f7a7 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -312,7 +312,7 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe if(ffStrbufIgnCaseEqualS(processName, "WindowsTerminal.exe")) return getTerminalVersionWindowsTerminal(exe, version); - if(ffStrbufStartsWithIgnCaseS(processName, "ConEmuC")) + if(ffStrbufStartsWithIgnCaseS(processName, "ConEmu")) return getTerminalVersionConEmu(exe, version); #endif diff --git a/src/detection/terminalshell/terminalshell_windows.c b/src/detection/terminalshell/terminalshell_windows.c index 165c14520..15c2da12f 100644 --- a/src/detection/terminalshell/terminalshell_windows.c +++ b/src/detection/terminalshell/terminalshell_windows.c @@ -107,7 +107,7 @@ static uint32_t getShellInfo(FFTerminalShellResult* result, uint32_t pid) ffStrbufIgnCaseEqualS(&result->shellPrettyName, "fastfetch") || //scoop warps the real binaries with a "shim" exe ffStrbufIgnCaseEqualS(&result->shellPrettyName, "flashfetch") || ffStrbufContainIgnCaseS(&result->shellPrettyName, "debug") || - ffStrbufStartsWithIgnCaseS(&result->shellPrettyName, "ConEmuC") // https://github.com/fastfetch-cli/fastfetch/issues/488#issuecomment-1619982014 + ffStrbufStartsWithIgnCaseS(&result->shellPrettyName, "ConEmu") // https://github.com/fastfetch-cli/fastfetch/issues/488#issuecomment-1619982014 ) { ffStrbufClear(&result->shellProcessName); ffStrbufClear(&result->shellPrettyName); @@ -178,8 +178,17 @@ static bool getTerminalFromEnv(FFTerminalShellResult* result) //ConEmu uint32_t pid = (uint32_t) strtoul(term, NULL, 10); result->terminalPid = pid; - getProcessInfo(pid, NULL, &result->terminalProcessName, &result->terminalExe, &result->terminalExeName); - return true; + if(getProcessInfo(pid, NULL, &result->terminalProcessName, &result->terminalExe, &result->terminalExeName)) + { + ffStrbufSet(&result->terminalPrettyName, &result->terminalProcessName); + if(ffStrbufEndsWithIgnCaseS(&result->terminalPrettyName, ".exe")) + ffStrbufSubstrBefore(&result->terminalPrettyName, result->terminalPrettyName.length - 4); + return true; + } + else + { + term = "ConEmu"; + } } //SSH @@ -295,7 +304,8 @@ static uint32_t getTerminalInfo(FFTerminalShellResult* result, uint32_t pid) ffStrbufIgnCaseEqualS(&result->terminalPrettyName, "fish") || ffStrbufIgnCaseEqualS(&result->terminalPrettyName, "nu") || ffStrbufIgnCaseEqualS(&result->terminalPrettyName, "powershell") || - ffStrbufIgnCaseEqualS(&result->terminalPrettyName, "powershell_ise") + ffStrbufIgnCaseEqualS(&result->terminalPrettyName, "powershell_ise") || + ffStrbufStartsWithIgnCaseS(&result->terminalPrettyName, "ConEmuC") // wrapper process of ConEmu ) { //We are nested shell ffStrbufClear(&result->terminalProcessName); @@ -334,8 +344,6 @@ static uint32_t getTerminalInfo(FFTerminalShellResult* result, uint32_t pid) ffStrbufSetS(&result->terminalPrettyName, "Visual Studio Code"); else if(ffStrbufIgnCaseEqualS(&result->terminalPrettyName, "explorer")) ffStrbufSetS(&result->terminalPrettyName, "Windows Explorer"); - else if(ffStrbufStartsWithIgnCaseS(&result->terminalPrettyName, "ConEmuC")) - ffStrbufSetS(&result->terminalPrettyName, "ConEmu"); else if(ffStrbufEqualS(&result->terminalPrettyName, "wezterm-gui")) ffStrbufInitS(&result->terminalPrettyName, "WezTerm");