Repository navigation
Description
Summary
After updating Codex CLI to 0.157.1 on Windows today, background command execution repeatedly opens visible CMD and/or PowerShell windows.
These windows do not just flash: they frequently steal foreground focus, which interrupts normal desktop use and can even break active typing/input in another window.
This appears related to #48540, #48440, #48356, and #48074, but I am opening this report because the focus-stealing / keyboard interruption is severe enough to make normal use difficult after the 0.157.1 update.
Environment
- OS: Windows
- Codex CLI: 0.157.1
- Shells observed: cmd.exe / PowerShell
- Regression noticed immediately after updating to 0.157.1
Steps to reproduce
- Update/install Codex CLI 0.157.1 on Windows.
- Start a normal Codex session.
- Ask Codex to perform work that executes background commands/tool calls.
- Continue using another application or typing while Codex works.
- Observe separate CMD/PowerShell windows repeatedly appear and disappear.
- The spawned window can take foreground focus, interrupting typing and normal interaction with the currently active application.
Actual behavior
- Background commands spawn visible console/PowerShell windows.
- Windows repeatedly flash/open and close during agent work.
- The spawned window can steal foreground focus.
- Keyboard input/typing in the user's current application is interrupted or redirected.
- This makes background execution intrusive and significantly disrupts normal desktop use.
Expected behavior
Background/non-interactive commands should run without creating visible foreground windows.
On Windows, child processes used for internal/background work should be launched in a way that prevents console-window creation or activation (for example, using the appropriate Windows process creation flags / hidden-window behavior where applicable).
Codex background work should never steal focus from the user's active application.
中文說明
今天將 Codex CLI 更新到 0.157.1 後,在 Windows 上發現明顯的 regression。
Codex 在執行各種 background command / tool call 時,會不斷額外開啟 CMD 或 PowerShell 視窗。這些視窗不只是短暫閃爍,還會頻繁搶走目前視窗的 focus,導致正在其他程式中的正常操作被中斷,甚至連正在輸入的文字都會被打斷或輸入到錯誤的視窗。
重現方式
- Windows 上更新 Codex CLI 至 0.157.1。
- 啟動 Codex CLI。
- 執行會觸發 background command / shell tool call 的一般任務。
- Codex 工作期間切換到其他程式並正常打字。
- 可以看到 CMD / PowerShell 視窗反覆跳出、消失。
- 這些視窗有時會搶走前景 focus,直接干擾鍵盤輸入。
預期行為
Codex 的 background / non-interactive command 應該在背景執行,不應產生可見的 CMD/PowerShell 視窗,更不應搶走使用者正在操作的前景視窗 focus。
希望 Windows 上的 background child process 能以不建立可見 console window、也不 activate foreground window 的方式啟動。
Related reports
- Windows: terminal window briefly flashes on every agent shell command after updating to 0.157.1 #48540 — Windows: terminal window briefly flashes on every agent shell command after updating to 0.157.1
- Windows: repeated focus-stealing console popups with shared background server enabled #48440 — Windows: repeated focus-stealing console popups with shared background server enabled
- Windows CLI 0.157.1: Plain text messages trigger background Git queries and flashing terminal windows (--no-daemon avoids this) #48356 — Windows CLI 0.157.1: background Git queries and flashing terminal windows
- Windows: terminal windows repeatedly flash during requests after installing the Codex daemon #48074 — Windows: terminal windows repeatedly flash during requests after installing the Codex daemon
Activity
github-actions commentedon Sep 28, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
vjaygiri46 commentedon Sep 28, 2026
Independent reproduction on Codex CLI 0.158.0 for Windows, installed through npm. I began seeing this after updating to 0.158.0; the prior version seemed quiet, but I have not verified the exact last good version.
Impact: Starting a normal CLI session can open roughly 20–30 short-lived PowerShell, CMD, or Windows Terminal windows. More appear during local tool calls. They take foreground focus and interrupt typing in Microsoft Word. Claude CLI on the same machine runs shell commands without this behavior (user observation).
Read-only checks on 2026-09-28:
%APPDATA%\npm\node_modules\@openai\codex\...\bin\codex.exe; the CLI displayedv0.158.0, and the session reportedCODEX_VERSION=0.158.0.%USERPROFILE%\.codex\packages\app-server-daemon\releases\0.158.0-x86_64-pc-windows-msvc\bin\codex.exe, runningapp-server --listen unix:// --managed-daemon.cmd.exeprocesses launching configured.cmdMCP scripts. Separate Codex desktop and VS Code app-server processes were also present.--no-daemoncontrol: A separate v0.158.0 CLI session launched with--no-daemonand successfully ran one read-only PowerShell command (Write-Output NO_DAEMON_TEST_OK). Its observedcmd.exehelpers were children of that CLI process rather than the managed server. The visual comparison was inconclusive because the original managed session remained active and the user could not confidently attribute popups to one session. No daemon was stopped and no configuration or version was changed.Expected: background commands and helpers should never create foreground windows or take focus from Word. This also appears related to #48422. Posted by Codex at the user's request; usernames, full local paths, and session contents are omitted.
etraut-openai commentedon Sep 29, 2026
We're tracking this in #48074, and we're working on a fix.