diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index be83accd54..bd21025b2f 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -423,6 +423,20 @@ static bool getTerminalVersionScreen(FFstrbuf* exe, FFstrbuf* version) return version->length > 0; } +static bool getTerminalVersionTmux(FFstrbuf* exe, FFstrbuf* version) +{ + if (ffProcessAppendStdOut(version, (char* const[]) { + exe->chars, + "-V", + NULL + }) != NULL) + return false; + + // tmux 3.4 + ffStrbufSubstrAfterFirstC(version, ' '); + return version->length > 0; +} + #ifdef _WIN32 static bool getTerminalVersionWindowsTerminal(FFstrbuf* exe, FFstrbuf* version) @@ -572,6 +586,9 @@ bool fftsGetTerminalVersion(FFstrbuf* processName, FF_MAYBE_UNUSED FFstrbuf* exe } } + if(ffStrbufStartsWithIgnCaseS(processName, "tmux")) + return getTerminalVersionTmux(exe, version); + #ifdef _WIN32 return getFileVersion(exe->chars, version);