From 11827d64bef9b68aacba66325a8ef85fd390052e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 2 Jul 2023 13:41:11 +0800 Subject: [PATCH] TerminalShell: fix compiling on macOS --- src/detection/terminalshell/terminalshell_linux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/detection/terminalshell/terminalshell_linux.c b/src/detection/terminalshell/terminalshell_linux.c index e13cd7725..f3255ea31 100644 --- a/src/detection/terminalshell/terminalshell_linux.c +++ b/src/detection/terminalshell/terminalshell_linux.c @@ -378,9 +378,12 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance) ffStrbufInitS(&result.shellPrettyName, result.shellExeName); } + if(ffStrbufEqualS(&result.terminalProcessName, "wezterm-gui")) + ffStrbufInitS(&result.terminalPrettyName, "WezTerm"); + #if defined(__linux__) || defined(__FreeBSD__) - if(ffStrbufStartsWithS(&result.terminalProcessName, "gnome-terminal-")) + else if(ffStrbufStartsWithS(&result.terminalProcessName, "gnome-terminal-")) ffStrbufInitS(&result.terminalPrettyName, "gnome-terminal"); #elif defined(__APPLE__) @@ -394,8 +397,6 @@ const FFTerminalShellResult* ffDetectTerminalShell(const FFinstance* instance) #endif - else if(ffStrbufEqualS(&result.terminalProcessName, "wezterm-gui")) - ffStrbufInitS(&result.terminalPrettyName, "WezTerm"); else 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