From 08e6db090b7c7f82b82c79aa8eec109be9eea404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 19 Aug 2025 17:25:04 +0800 Subject: [PATCH] Shell (Windows): be compatible with fish 4 built by MSYS2 --- src/detection/terminalshell/terminalshell.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/detection/terminalshell/terminalshell.c b/src/detection/terminalshell/terminalshell.c index d8cc0cd7e..d2d2b7438 100644 --- a/src/detection/terminalshell/terminalshell.c +++ b/src/detection/terminalshell/terminalshell.c @@ -85,8 +85,9 @@ static bool getShellVersionFish(FFstrbuf* exe, FFstrbuf* version) if(!getExeVersionRaw(exe, version)) return false; - //fish, version 3.6.0 - ffStrbufSubstrAfterLastC(version, ' '); + //fish, version 4.0.2-1 (Built by MSYS2 project) + ffStrbufSubstrAfterFirstS(version, "version "); + ffStrbufSubstrBeforeFirstC(version, ' '); return true; }