diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index d2df1137b..40f5129d3 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -408,6 +408,21 @@ FF_MAYBE_UNUSED static bool getTerminalVersionLxterminal(FFstrbuf* exe, FFstrbuf return version->length > 0; } +FF_MAYBE_UNUSED static bool getTerminalVersionWeston(FF_MAYBE_UNUSED FFstrbuf* exe, FFstrbuf* version) +{ + // weston-terminal doesn't report a version, use weston version instead + if(ffProcessAppendStdOut(version, (char* const[]){ + "weston", + "--version", + NULL + })) return false; + + //weston 8.0.0 + ffStrbufSubstrAfterFirstC(version, ' '); + + return version->length > 0; +} + static bool getTerminalVersionContour(FFstrbuf* exe, FFstrbuf* version) { const char* env = getenv("TERMINAL_VERSION_STRING"); @@ -536,6 +551,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe if(ffStrbufIgnCaseEqualS(processName, "lxterminal")) return getTerminalVersionLxterminal(exe, version); + if(ffStrbufIgnCaseEqualS(processName, "weston-terminal")) + return getTerminalVersionWeston(exe, version); + if(ffStrbufIgnCaseEqualS(processName, "urxvt") || ffStrbufIgnCaseEqualS(processName, "urxvtd") || ffStrbufIgnCaseEqualS(processName, "rxvt") ||