Repository navigation
Windows: repeated focus-stealing console popups with shared background server enabled #48440
Description
What version of Codex CLI is running?
0.157.1
What subscription do you have?
ChatGPT Pro
Which model were you using?
gpt-6-astra (high)
What platform is your computer?
Windows 11, x64
What terminal emulator and version are you using (if applicable)?
VS Code integrated terminal. Also reproduced in a separate Windows Terminal window. Exact terminal versions not collected.
Codex doctor report
Not collected. Diagnostic observations are included below.What issue are you seeing?
Codex CLI 0.157.1 on Windows repeatedly opens bursts of 3–5 blank CMD/Windows Terminal windows. They immediately disappear and steal keyboard focus, making typing extremely difficult.
This occurs when submitting prompts, sometimes before the Working indicator appears, after pressing Esc to interrupt and submitting another prompt, and during command execution.
The problem occurs in both the VS Code integrated terminal and a separate Windows Terminal. Changing the terminal profile and using tty=true/login=false for exec_command did not eliminate the overall issue.
A local process/window trace recorded Git subprocesses launched by the shared background server during bursts of terminal window creation and focus stealing. The exact Git commands and root cause remain unconfirmed.
After restarting with codex.cmd --no-daemon, the popups appear to have stopped so far.
What steps can reproduce the bug?
- Run Codex CLI 0.157.1 on Windows in a Git working directory with the shared background server enabled.
- Submit a prompt.
- Press Esc to interrupt a response, then submit another prompt.
- Observe bursts of blank console windows that briefly appear and steal keyboard focus.
The issue is intermittent and does not occur on every attempt. It also occurs during ordinary command execution.
After restarting/resuming with codex.cmd --no-daemon, the popups appear to have stopped so far.
What is the expected behavior?
Submitting prompts, interrupting/resuming responses, and running noninteractive background operations should not open separate console windows or steal keyboard focus.
Additional information
A local process/window event trace recorded the shared background server's codex.exe spawning multiple Git for Windows processes during bursts of console window creation and foreground activation.
The exact Git arguments were not captured, so the specific operation and root cause remain unconfirmed. Manually opened terminals were excluded from the automatic-popup observations.
Using tty=true and login=false for exec_command did not eliminate the overall issue. These options apply to tool calls, not necessarily to internal Git subprocesses launched by the shared server.
The --no-daemon workaround appears effective so far, but sustained testing has not been completed.
The persistent setting features.daemon_auto_start=false was subsequently saved. Normal startup behavior with this setting has not yet been verified.
Please investigate Windows console creation and stdio handling for internal subprocesses launched by the shared background server.
Built-in feedback submission identifier:
no-active-thread-01a0ddbe-aace-7e60-86cb-39bd1b8f00d3
Private project paths, company files, raw logs, and conversation transcripts are omitted.
Activity
github-actions commentedon Sep 26, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
kimust commentedon Sep 26, 2026
Related to #48356 and #48422.
I also experienced this on 0.157.1 in VS Code and Windows Terminal. Using --no-daemon appears to stop the focus-stealing console popups.
Chokitus commentedon Sep 26, 2026
Had this problem with 0.157.0 and 0.157.1 as well.
Zerosven commentedon Sep 27, 2026
Confirming this on Windows: Codex briefly opens separate console windows while working, in VS Code and also outside VS Code (less frequently). This started recently after an update.
codex --no-daemonstops the popups when I launch the CLI. Downgrading the global npm CLI to 0.156.1 did not stop them in VS Code; the packaged app-server is separate from that CLI. My local logs identify the command runner as 0.157.1. They also show an occasionalrunner exit write failed: pipe is closing (os error 232).I have not changed sandbox permissions. Private project paths, raw logs, and conversation data are omitted.
qunnn41 commentedon Sep 28, 2026
Additional diagnostic evidence from another affected Windows x64 machine:
codex --versionconfirmed 0.155.1.allow_login_shell = falsein the global config and restarting the affected session also did not stop it.%USERPROFILE%\.codex\packages\app-server-daemon\releases\0.157.1-x86_64-pc-windows-msvc\bin\codex.exe, pluscodex-code-mode-host.exefrom the same release. The daemon package'scurrentjunction pointed to that release.pwsh.exe, withconhost.exechildren. This establishes process ancestry, but we did not capture foreground-window events, so it does not prove which child stole focus.currentjunction, and deleting that specific release directory, the popups appear to have stopped so far. The npm CLI remains at 0.155.1. Sustained testing and re-enabling the daemon have not been performed.Windows Terminal settings were not changed. The observed Windows Terminal package version was 1.18.10301.0 (x64), with PowerShell 7.
This supports investigating the shared daemon's Windows subprocess/console creation behavior. It also shows why checking only
codex --versionafter a CLI rollback can miss a separately installed, still-running 0.157.1 daemon. Exact root cause remains unconfirmed.elysoto commentedon Sep 29, 2026
Can confirm that --no-daemon fixes this issue for me. It is especially obvious when running /review.
etraut-openai commentedon Sep 29, 2026
We're tracking this in #48074, and we're working on a fix.