You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use codex for my project. But I get strange issues that codex can't read/edit files.
While running I see plenty of errors like that:
` Explored
└ List ls -la
Search rg --files
Search find . -maxdepth 3 -type d -print
• Ran cat -n README.md | sed -n '1,120p'
└ bash: cat: command not found
bash: sed: command not found
`
Tried installing codex from npm and brew. No changes. When I'm asking codex to chcek it - sometimes it's using python to do it.
I checked my shell options - ls, grep, sed - this should be available. Gemini or Claude CLI have no issues here.
I changed approval to full - same. Codex is just giving me code to paste and saying:
If you want, I can apply this change directly, but my current environment can’t read files. Paste the body of DashboardView here, or grant me a quick project scan, and I’ll patch it for you. Token usage: total=10046 input=4202 (+ 55936 cached) output=5844 (reasoning 4864)
OK. I turned on logs. But I need to wait for these errors.
What changed.
After asking for summary about my codebase - codex started editing files by ... using workaround with python scripts. It's now instead of LS, SED using small python scripts to do that.
But I was able to get some errors with new session and new task (just for this case).
Now - grep started working because codex told me that it is starting to use absolute paths for commands. But ask you can see - the issue is with "head"
For anyone running into this problem, here is my case
The Codex cli always runs commands by calling:
bash -lc "your command"
(for example, bash -lc "ls -la" or bash -lc "pwd").
If you’re using fish (or any shell other than bash) as your main shell, this can break if your ~/.bash_profile or ~/.bashrc forces bash to immediately exec into another shell. In my case, my ~/.bash_profile looked like this:
Because of the exec /bin/zsh -l, bash never actually ran the command — it just switched over to zsh and stopped, causing empty output for codex cli
Fix:
Check your ~/.bash_profile or ~/.bashrc for any lines like exec /bin/zsh -l (or exec fish -l) and remove them. After I removed that line, Codex worked perfectly again, even though my main shell is still fish.
Activity
jif-oai commentedon Sep 8, 2025
Thanks for your message. Can you provide me the logs that you have on those sessions ?
For this:
export RUST_LOG="warn,codex_core=trace,codex_tui=trace"~/.codex/log/codex-tui.logif you are using a terminaladek commentedon Sep 8, 2025
OK. I turned on logs. But I need to wait for these errors.
What changed.
After asking for summary about my codebase - codex started editing files by ... using workaround with python scripts. It's now instead of LS, SED using small python scripts to do that.
But I was able to get some errors with new session and new task (just for this case).
` Proposed Command
└ /usr/bin/grep -RIN "card|Card|cardsOrder|order" XXX/SUI/Features/Dashboard XXX/SUI/Common | head -n 50
✔ You approved codex to run /usr/bin/grep -RIN "card|Card|cardsOrder|order" XXX/SUI/Features/Dashboard... this time
• Ran /usr/bin/grep -RIN "card|Card|cardsOrder|order" XXX/SUI/Features/Dashboard XXX/SUI/Common | head -n 50
└ bash: head: command not found
grep: invalid option -- N
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
• Proposed Command
└ /usr/bin/grep -RIsn "card|Card|cardsOrder|order" XXX/SUI/Features/Dashboard XXX/SUI/Common | /usr/bin/sed -n '1,80p'`
Now - grep started working because codex told me that it is starting to use absolute paths for commands. But ask you can see - the issue is with "head"
adek commentedon Sep 9, 2025
I've sent you mail with new logs. Same issue with 0.31.0
minhluuquang commentedon Sep 13, 2025
For anyone running into this problem, here is my case
The Codex cli always runs commands by calling:
bash -lc "your command"
(for example, bash -lc "ls -la" or bash -lc "pwd").
If you’re using fish (or any shell other than bash) as your main shell, this can break if your ~/.bash_profile or ~/.bashrc forces bash to immediately exec into another shell. In my case, my ~/.bash_profile looked like this:
Because of the exec /bin/zsh -l, bash never actually ran the command — it just switched over to zsh and stopped, causing empty output for codex cli
Fix:
Check your ~/.bash_profile or ~/.bashrc for any lines like exec /bin/zsh -l (or exec fish -l) and remove them. After I removed that line, Codex worked perfectly again, even though my main shell is still fish.
d-klotz commentedon Sep 19, 2025
Codex is stuck for me when I run the /init command.
I only get this:
Exploring └ List lsAnd it keeps there forever.
I'm using Zsh as terminal.
michaelfortunato commentedon Oct 24, 2025
etraut-openai commentedon Dec 23, 2025
This bug report is very old and likely stale. Closing.