Windows: secondary Codex session spawns visible console windows for child executable calls
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
On Windows, a primary Codex terminal/session behaves normally, but a second Codex tab/session appears to launch child executable calls in separate visible console windows.
This is reproducible specifically in the secondary session. The primary session does not exhibit the behavior.
Environment
- Windows 11
- Codex running in terminal tabs
- Multiple Codex sessions open concurrently
- Windows Terminal used as the terminal host
Reproduction
- Start a Codex session in one terminal tab.
- Run normal work involving shell/tool calls (
pwsh,git,gh, etc.). - Open a second terminal tab and start a second Codex session.
- In the second session, run work that triggers shell/tool calls.
- Observe that many child executable calls spawn their own visible console/terminal windows.
Actual behavior
- In the first/main Codex session, child commands execute without spawning visible external console windows.
- In the second Codex session, many executable calls open a separate visible terminal/console window.
- The windows typically show a successful exit, e.g.:
[process exited with code 0 (0x00000000)]
You can now close this terminal with Ctrl+D, or press Enter to restart.
- Changing Windows Terminal's setting to close automatically on clean exit reduces the symptom from accumulated windows to a brief visible flicker, but the secondary-session child consoles are still being created and remain disruptive.
Expected behavior
Child executable calls in additional Codex sessions should behave like those in the primary session: remain attached to/contained within the existing terminal/PTY (or otherwise run hidden) rather than creating visible transient console windows.
Important differentiator
This does not happen in the main/first Codex tab. It appears tied specifically to running a second concurrent Codex session/tab.
That suggests this may involve secondary-session console/PTY inheritance or Windows process creation flags rather than a generic Windows shell configuration issue.
Impact
The behavior is especially disruptive for autonomous/agent-style workflows that execute many short-lived commands, since each subprocess can cause a visible window flash.
A screenshot is available showing multiple short-lived terminal windows created by the secondary session.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing secondary-session console/PTY inheritance and Windows process creation flags for shell/tool calls such as pwsh, git, and gh. Compare child-process behavior between the primary and secondary sessions. Done means executable calls in additional sessions remain contained in the existing terminal or run hidden, without visible console windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100