diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index 6d6f5b6b6..d3c69d63e 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -707,6 +707,20 @@ FF_MAYBE_UNUSED static bool getTerminalVersionSakura(FFstrbuf* exe, FFstrbuf* ve ffStrbufSubstrAfterLastC(version, ' '); return true; } + +FF_MAYBE_UNUSED static bool getTerminalVersionTermite(FFstrbuf* exe, FFstrbuf* version) +{ + if(ffProcessAppendStdOut(version, (char* const[]) { + exe->chars, + "--version", + NULL + }) != NULL) // termite v16.9\nvte 0.78.1 +BIDI +GNUTLS +ICU +SYSTEMD + return false; + + ffStrbufSubstrBeforeFirstC(version, '\n'); + ffStrbufSubstrAfterLastC(version, 'v'); + return true; +} #endif #ifdef _WIN32 @@ -812,6 +826,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe if(ffStrbufIgnCaseEqualS(processName, "sakura")) return getTerminalVersionSakura(exe, version); + if(ffStrbufIgnCaseEqualS(processName, "termite")) + return getTerminalVersionTermite(exe, version); + #endif #ifdef _WIN32