From e28624ebef5af95d1b884e52e684caeb4dbbbf3b Mon Sep 17 00:00:00 2001 From: Jeremy Mack Date: Thu, 26 Mar 2026 08:05:01 -0500 Subject: [PATCH] Use nodePath.sep instead of hardcoded slash in isPathWithinRoot Fixes path containment check on Windows where the separator is backslash. Currently this breaks find, grep, cat, etc. --- src/fs/real-fs-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fs/real-fs-utils.ts b/src/fs/real-fs-utils.ts index 1091b04b..1108ac2c 100644 --- a/src/fs/real-fs-utils.ts +++ b/src/fs/real-fs-utils.ts @@ -25,7 +25,7 @@ export function isPathWithinRoot( resolved: string, canonicalRoot: string, ): boolean { - return resolved === canonicalRoot || resolved.startsWith(`${canonicalRoot}/`); + return resolved === canonicalRoot || resolved.startsWith(`${canonicalRoot}${nodePath.sep}`); } /**