Weird shell escape / quoting issues when running commands

Resolved 💬 3 comments Opened Nov 20, 2025 by ci Closed Nov 20, 2025
💡 Likely answer: A maintainer (dylan-hurd-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.60.1

What subscription do you have?

Pro

Which model were you using?

gpt-5.1-codex-max xhigh

What platform is your computer?

Darwin 24.3.0 arm64 arm

What issue are you seeing?

Running shell commands adds extra quoting around && or | and the LLM gets super confused, fails to do anything. OSX & fish shell

› run ls && rg test | head -1


• Ran ls '&&' rg test '|' head -1
  └ ls: &&: No such file or directory
    ls: -1: No such file or directory
    … +2 lines
    ls: test: No such file or directory
    ls: |: No such file or directory

• Explored
  └ List ls
    Search test

─ Worked for 28s ──────────────..

• Ran ls && rg test | head -1 (via bash for shell operators). Output:

  - test123
  - rg found no matches for "test", so nothing from the pipe.

What steps can reproduce the bug?

Uploaded thread: 019aa18e-97a3-7330-b9e1-7576e2c3ddd8

In my case just running run ls && rg test | head -1 makes it happen. Happens with any model.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

3 Comments

asafyish · 9 months ago

Had the same issues, oddly enough solved it with:

[features]
unified_exec = true

in config.toml.

I am on osx using fish shell if it helps.

ci · 9 months ago
Had the same issues, oddly enough solved it with: [features] unified_exec = true in config.toml. I am on osx using fish shell if it helps.

that does help, thanks @asafyish!

dylan-hurd-oai contributor · 9 months ago

Helpful bug reports! We welcome feedback on unified_exec, but the default setup should be fixed for fish users in 0.61.0. Closing as a duplicate of #6940