Skip to content

fix(grep): normalize path-prefixed file_glob and run grep directly without shell quoting - #753

Merged
dwash96 merged 2 commits into
cecli-dev:v1.13.0from
philippeback:fix/windows-grep-file-glob
Nov 15, 2026
Merged

dwash96 merged 2 commits into
cecli-dev:v1.13.0from
philippeback:fix/windows-grep-file-glob

Conversation

@philippeback

Copy link
Copy Markdown

Closes #752

Summary

Fixes two bugs causing Grep to silently return "No matches found" on Windows:

  1. Path-prefixed file_glob values (e.g. pine_sources/Foo.pine or pine_sources/*.pine) were passed to GNU grep --include / PowerShell -Filter, which only match basenames.
  2. rg/ag/grep commands were shell-joined with oslex.join and passed through run_cmd_subprocess; when tool_path contained spaces and run_cmd_subprocess wrapped the string in powershell -EncodedCommand, PowerShell failed to parse "C:\..." without & and exited with status 1.

Changes

  • Normalize single path-prefixed file_glob values relative to search_dir_path and add -H for GNU grep so single-file searches always emit the filename.
  • Execute rg/ag/grep directly via subprocess.run(..., shell=False) (_run_grep_subprocess).
  • Add test_grep_path_prefixed_file_glob_finds_matches in tests/tools/test_grep.py.

Testing

  • pytest tests/tools/test_grep.py -k "test_grep_path_prefixed_file_glob_finds_matches or test_grep_regex_uses_pcre_when_available or test_grep_comma_separated_globs_are_supported" -q (3 passed).

@dwash96
dwash96 changed the base branch from main to v1.13.0 November 15, 2026 11:43
@dwash96
dwash96 merged commit f6206e3 into cecli-dev:v1.13.0 Nov 15, 2026
11 of 12 checks passed
@dwash96 dwash96 mentioned this pull request Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grep returns 0 matches on Windows for path-prefixed file_glob and spaced tool paths

2 participants