From 1431cdcc836a0aedeb214ada4541dd93d42c3c53 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Tue, 28 Nov 2023 23:44:32 +0900 Subject: [PATCH] fix(Terminal): make fastfetch works under ltrace and perf Fastfetch incorrectly displays the terminal name as "ltrace" or "perf" when debugging itself with ltrace and perf. minor fix: remove duplicated ffStrbufClear since getShellVersion already called it. --- src/detection/terminalshell/terminalshell_linux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index 518f0df7f..c11fb9a55 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -140,6 +140,8 @@ static void getTerminalShell(FFTerminalShellResult* result, pid_t pid) strcasecmp(name, "gdb") == 0 || strcasecmp(name, "lldb") == 0 || strcasecmp(name, "login") == 0 || + strcasecmp(name, "ltrace") == 0 || + strcasecmp(name, "perf") == 0 || strcasecmp(name, "guake-wrapped") == 0 || strcasestr(name, "debug") != NULL || strcasestr(name, "command-not-found") != NULL || @@ -348,7 +350,6 @@ const FFTerminalShellResult* ffDetectTerminalShell() getTerminalFromEnv(&result); getUserShellFromEnv(&result); - ffStrbufClear(&result.shellVersion); getShellVersion(&result.shellExe, result.shellExeName, &result.shellVersion); if(ffStrbufEqualS(&result.shellProcessName, "pwsh"))