rg fails with some special pattern in .gitignore

Resolved 💬 3 comments Opened Oct 9, 2025 by Meowzz95 Closed Oct 16, 2025

What version of Codex is running?

codex-cli 0.46.0

Which model were you using?

gpt-5-codex hight

What platform is your computer?

Darwin 25.0.0 arm64 arm

What steps can reproduce the bug?

Having this in .gitignore

# General
.DS_Store
__MACOSX/
.AppleDouble
.LSOverride
Icon[
]

I don't know if the Icon[ and ] are supposed to be on two lines but this triggers rg error when codex try to search something in the codebase

• Ran rg --line-number "someFunc" -n xxxxxx/src -g"*.ts" -g"*.vue"
  └ failed in sandbox: rg: /Users/xxxx/.gitignore: line 50: error
    parsing glob 'Icon[': unclosed character class; missing ']'

Although codex will figure out some other commend to search but I think this can be avoided (?)

What is the expected behavior?

Although codex will figure out some other commend to search but I think this can be avoided (?)

What do you see instead?

Shown in repro

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗