From 6e190c6f7c79dd664296cd73826c61abaffec11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 9 Oct 2022 17:47:30 +0800 Subject: [PATCH] Fix some mistakes --- src/detection/font/font.h | 2 +- src/detection/terminalfont/terminalfont_linux.c | 3 ++- src/detection/terminalshell/terminalshell_windows.cpp | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/detection/font/font.h b/src/detection/font/font.h index e28446e66..63d19e2ee 100644 --- a/src/detection/font/font.h +++ b/src/detection/font/font.h @@ -14,7 +14,7 @@ typedef struct FFFontResult /** * Linux / BSD: QT, GTK2, GTK3, GTK4 * MacOS: System, User, Monospace, Application - * Windows: Desktop, User, Unset, Unset + * Windows: Desktop, Unset, Unset, Unset * Other: Unset, Unset, Unset, Unset */ FFstrbuf fonts[FF_DETECT_FONT_NUM_FONTS]; diff --git a/src/detection/terminalfont/terminalfont_linux.c b/src/detection/terminalfont/terminalfont_linux.c index f7f4de454..ee381744e 100644 --- a/src/detection/terminalfont/terminalfont_linux.c +++ b/src/detection/terminalfont/terminalfont_linux.c @@ -352,7 +352,8 @@ void ffDetectTerminalFontPlatform(const FFinstance* instance, const FFTerminalSh detectFromGSettings(instance, "/com/gexperts/Tilix/profiles/", "com.gexperts.Tilix.ProfilesList", "com.gexperts.Tilix.Profile", terminalFont); else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "gnome-terminal-") == 0) detectFromGSettings(instance, "/org/gnome/terminal/legacy/profiles:/:", "org.gnome.Terminal.ProfilesList", "org.gnome.Terminal.Legacy.Profile", terminalFont); - else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "Windows Terminal") == 0) + else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "Windows Terminal") == 0 || + ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "WindowsTerminal.exe") == 0) detectFromWindowsTeriminal(instance, terminalFont); else if(ffStrbufIgnCaseCompS(&terminalShell->terminalProcessName, "mintty") == 0) detectMintty(instance, terminalFont); diff --git a/src/detection/terminalshell/terminalshell_windows.cpp b/src/detection/terminalshell/terminalshell_windows.cpp index d4deea9b3..bdb604a95 100644 --- a/src/detection/terminalshell/terminalshell_windows.cpp +++ b/src/detection/terminalshell/terminalshell_windows.cpp @@ -91,11 +91,11 @@ static uint32_t getTerminalInfo(FFTerminalShellResult* result, uint32_t pid) ffStrbufSet(&result->terminalPrettyName, &result->terminalProcessName); if(ffStrbufEndsWithIgnCaseS(&result->terminalPrettyName, ".exe")) - result->terminalProcessName.length -= 4; + ffStrbufSubstrBefore(&result->terminalPrettyName, result->terminalPrettyName.length - 4); - if(ffStrbufIgnCaseCompS(&result->terminalPrettyName, "WindowsTerminal")) + if(ffStrbufIgnCaseCompS(&result->terminalPrettyName, "WindowsTerminal") == 0) ffStrbufSetS(&result->terminalPrettyName, "Windows Terminal"); - else if(ffStrbufIgnCaseCompS(&result->terminalPrettyName, "conhost")) + else if(ffStrbufIgnCaseCompS(&result->terminalPrettyName, "conhost") == 0) ffStrbufSetS(&result->terminalPrettyName, "Console Window Host"); return ppid;