We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d805db9 commit b8144ccCopy full SHA for b8144cc
1 file changed
src/utils/tools/filesystem.ts
@@ -145,8 +145,11 @@ export async function grepSearch(
145
146
// Try ripgrep first for better performance
147
try {
148
+ const escapedPattern = pattern.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
149
+ const escapedDirPath = dirPath.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
150
+
151
const { stdout } = await execShell(
- `rg --line-number --no-heading --smart-case "${pattern.replace(/"/g, '\\"')}" "${dirPath}"`,
152
+ `rg --line-number --no-heading --smart-case "${escapedPattern}" "${escapedDirPath}"`,
153
);
154
// v8 ignore next
155
return { content: stdout || 'No matches found' };
0 commit comments