i face issue on codex app desktop app i try to open terminal not opening, is this only on my pc or what? how to fix it?
If Ctrl + J does not open the terminal in Codex, but only for a specific project, first check whether Git trusts that repository.
Run this inside the project:
git status
If you see an error like:
fatal: detected dubious ownership in repository
it means the repo was created or owned by a different user, such as a sandbox, admin account, WSL, VM, or agent runtime. Because of that, Codex cannot resolve the Git root for that project, and the terminal shortcut may appear broken only in that project.
Fix it with:
git config --global --add safe.directory C:/path/to/project
Example:
git config --global --add safe.directory C:/Users/MyUser/Documents/my-projects
Then restart Codex or open a new thread and try Ctrl + J again.
Itās not actually a Ctrl + J problem. Codex cannot resolve the project because Git blocks the repo with a dubious ownership error. Add the project to Gitās safe.directory, restart Codex, and the terminal should work again.
The issue persists. I currently have no projects open, and I have already tried removing all projects and reinstalling Codex, but the terminal still will not open. I also just updated Windows, but the problem remains. Additionally, I cannot connect to Git.
Iām facing the same issue on the Mac App `Version 26.818.21641` .
No way to Open the integrated Terminal.
It may help to share your operating system, Codex app version, and what happens when you click the terminal. Does restarting the app or testing another project change the issue?
I am currently using Windows 11 along with Codex version 26.818.31338, however, I have encountered the same problem in older versions of Codex too.
In general, I like to keep 3-4 React projects open at once. The terminal works fine in some of them, however, in one or two of them, if I try to open the terminal, it opens and instantly closes itself.
What is weird is the fact that whenever I first start the project, the terminal works perfectly fine. However, after working on that particular project for some time, the problem starts. And from there on, I can no longer use the terminal within that particular project, whereas in other open projects, the terminal works normally.
I have already tried restarting Codex, reopening the project, and some other forms of basic troubleshooting methods, however, the problem persists.
It seems that this is not a problem exclusive to the latest version of Codex since I used to encounter the same behavior with older versions as well.
Environment:
- Operating System: Windows 11
- Codex: 26.818.31338
- Project type: React / JavaScript projects
- Number of projects open at once: 3-4
- Problem: The integrated terminal opens and instantly closes itself in certain projects
Has anybody else come across such a problem? Is this something related to the project workspace, terminal process, shell settings, or Codex itself?
Any advice on how to debug this or even fix this would be great.
Same issue, terminal opens and immediately closes!
Windows 11
Codex 26.818.61809
Make sure you are in Codex mode, not ChatGPT mode. Terminal will not show up in ChatGPT mode.
yes im in codex mode, i have 2 project same stack react based on one terminal working fine on another when click on terminal autoclose terminal ?
Hey yall,
I have been experiencing the same issues as you all. Nothing above worked. Terminal will open and then close immediately. I had Codex (Astra) within a project investigate.
This was my chat and work done.
My message:
it seems to still be doing it after restart. can you try to open terminal in codex again and check local Codex logs for a concrete PTY/session errors.
Can you continue looking and checking things to do to fix this? Even if you need to go into the codex bundle or something please i want the integrated terminal to work
Codex Response:
Iāll inspect how the installed app creates terminal sessions and compare that with its logs. The earlier explanations went beyond the evidence: weāve confirmed the panel fails, but havenāt established why.
Edited files, read files, ran commands
I found another clue: the app logged spawn tar ENOENT, meaning it couldnāt locate tar, and it also reported Git unavailable. Iām checking the appās environment and shell startup files to see whether these failures share a cause.
Loaded a tool, read files, ran commands
Iāve reproduced a concrete configuration problem: line 25 of your .zshrc inserts the error output from npm bin -g into PATH. The environment inherited by Codex is cut off at that error, leaving out /usr/bin and /bin; command lookup fails there, while absolute paths work.
Iāll back up the file and remove that obsolete line, then test a fresh shell. This is a strong lead, but the integrated terminal will still need verification after the app reloads its environment.Edited a file, ran commands, opened terminal, read terminal
The shell-file fix passes testing: a fresh login shell now has a clean PATH and can find git, tar, and zsh. Your original .zshrc is backed up.
The running app still has its old environment, and another terminal-open attempt hasnāt attached a session. Iām checking the bundleās environment-loading code before asking you to restart, so we know what the restart should change.
I found and fixed a concrete problem in your .zshrc: an obsolete
npm bin -gcommand was inserting multiline error text intoPATH.The app bundle confirms Codex reads that environment line by line, truncating
PATHbefore essential system directories. That explains the āGit unavailableā and ātar not foundā errors.I removed that line, backed up the original, and verified fresh shells can find
git,tar, andzsh. No app-bundle changes were needed.Please fully quit the app with āQ, then reopen it and try the integrated terminal. The running app still holds the broken environment; reopening the panel alone wonāt refresh it.
I havenāt confirmed the integrated terminal works yet. After restarting, reply here and Iāll check its session and fresh logs.
This looked to be the main issue āI found and fixed a concrete problem in your .zshrc: an obsolete npm bin -g command was inserting multiline error text into PATH.ā
Hopefully this helps someone out there!!
Fix Codex Terminal Auto-Close on Windows
in my case this worked!
If the Codex integrated terminal opens and immediately closes on certain projects, the issue may be caused by Git repository ownership.
In my case, the `.git` folder was owned by `CodexSandboxOffline` instead of my normal Windows user account.
1. Install Git for Windows
If Git is not installed, download and install it first:
> https://git-scm.com/download/win
Then verify:
open powershell
git --version
2. Open Your Project in PowerShell
Go to the affected project folder:
cd "YOUR_PROJECT_FOLDER"
Then run:
git status
If you see an error like:
fatal: detected dubious ownership in repository
and the repository is owned by something like:
CodexSandboxOffline
then continue with the fix below.
3. Fixthe `.git` Folder Ownership
First, fully close Codex.
Then open PowerShell as Administrator and go to the same project folder.
Run:
icacls ".git" /setowner "$env:USERDOMAIN\\$env:USERNAME" /T /C
This changes the `.git` folder ownership back to your current Windows user.
4. Test Again
Run:
git status
If the ownership error is gone, reopen Codex and try the integrated terminal again.
Quick Summary
Install Git
ā
Open project in PowerShell
ā
Run: git status
ā
If you get ādubious ownershipā
ā
Close Codex
ā
Open PowerShell as Administrator
ā
Run the icacls ownership fix
ā
Run git status again
ā
Restart Codex
Note:
> You only need to install Git once.
> Use the ownership fix only for projects that show the ādubious ownershipā error.