diff --git a/webview-ui/src/utils/path-mentions.ts b/webview-ui/src/utils/path-mentions.ts index 4ad25b9b5..d2cdc8696 100644 --- a/webview-ui/src/utils/path-mentions.ts +++ b/webview-ui/src/utils/path-mentions.ts @@ -9,7 +9,7 @@ * @returns A path with spaces escaped */ export function escapeSpaces(path: string): string { - return path.replace(/ /g, "\\ ") + return path.replace(/\\/g, "\\\\").replace(/ /g, "\\ ") } /**