Repository navigation
Description
What version of the Codex App are you using?
Codex Desktop for Windows, installed package observed as OpenAI.Codex_26.519.2081.0_x64__2p2nqsd0c76g0 with Electron crashpad annotation version 26.519.21041.
What operating system are you using?
Windows with Codex configured to run in WSL (runCodexInWindowsSubsystemForLinux = true).
What steps can reproduce the bug?
- Start Codex Desktop on Windows.
- Work in another desktop application or another terminal tab/window.
- Leave Codex Desktop running for a short while.
- Observe intermittent flashes of a terminal/console window or tab opening and immediately closing.
I confirmed this by watching Windows process creation. Codex Desktop periodically launches a short-lived PowerShell process similar to:
powershell.exe -NoProfile -NonInteractive -Command "$ErrorActionPreference = 'Stop'; $cpuByPid = @{}; Get-CimInstance Win32_PerfFormattedData_PerfProc_Process | ForEach-Object { $cpuByPid[[int]$_.IDProcess] = [double]$_.PercentProcessorTime }; Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine,WorkingSetSize,@{Name='CpuPercent';Expression={$cpuByPid[[int]$_.ProcessId]}},@{Name='AgeSeconds';Expression={[int]((Get-Date) - $_.CreationDate).TotalSeconds}} | ConvertTo-Json -Depth 2"The parent process is Codex.exe. Each probe also creates a transient conhost.exe, which appears to be the visible flash/focus-stealing window.
What is the expected behavior?
Background process/resource probes should run without surfacing a console window and without stealing focus from other applications or terminal tabs. On Windows this likely means launching the child process hidden / with no console window, or using a non-console process collection path.
What happens instead?
A console window flashes briefly and steals focus. This interrupts typing in other desktop applications and other terminal tabs, making the Desktop app difficult to leave running while working.
Additional context
This does not appear to be caused by user tmux hooks, cron jobs, or devkit shell launchers. In the observed process tree, the repeating powershell.exe probe is a direct child of Codex.exe.
A CLI-only Codex session does not appear to trigger the same visible Windows console flash in my testing, so this seems specific to Codex Desktop on Windows.
Activity
github-actions commentedon May 21, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
XLGXB commentedon May 25, 2026
I can reproduce a related Windows trigger with command hooks enabled, separately from the periodic background probe in the original report.
Observed process chain during a visible flash:
Codex.exe -> codex.exe -> pwsh.exe -NoProfile -Command "context-mode hook codex userpromptsubmit"Codex.exe -> codex.exe -> pwsh.exe -NoProfile -Command "context-mode hook codex stop"This suggests changing a hook's
command/commandWindowsvalue cannot fully fix the flash: the outer shell process is already created by Codex before the hook command runs.Source check on current
main:codex-rs/core/src/session/mod.rs:build_hooks_for_config()derives hook execution viauser_shell.derive_exec_args("", false).codex-rs/core/src/shell.rs: on Windows, PowerShell commands becomepwsh.exe -NoProfile -Command ....codex-rs/hooks/src/engine/command_runner.rs: the hookCommandis spawned after stdio piping, without an apparent Windows no-console creation flag.Potential minimal fix: on Windows, set
CREATE_NO_WINDOW(0x08000000) on the hook process beforecommand.spawn(), since hooks already communicate through piped stdio and are non-interactive. This should preserve hook functionality while preventing transient PowerShell/conhost windows.I did not include local logs or user paths here, but can provide sanitized process-capture details if useful.
neavo commentedon May 26, 2026
same on my pc
fix(windows): suppress console window flash on shell tool spawns
rwang23 commentedon Jul 16, 2026
I found a separate, adjacent presentation path that may help distinguish Windows reports.
When the Windows default-terminal setting is Automatic, some otherwise-unbound Codex console UI can be brokered through WindowsTerminal.exe / OpenConsole.exe. Those CASCADIA_HOSTING_WINDOW_CLASS windows can be service-owned rather than descendants of the Codex process, so an ancestry-only guard cannot safely target them without risking a user's own terminal.
On one Windows test system, explicitly selecting Windows Console Host for the current user's default-terminal delegation stopped that brokered Terminal-flash class. I documented a reversible local mitigation, including its limits, here:
https://github.com/rwang23/codex-windows-console-guard
This does not explain or fix the direct Codex.exe -> powershell.exe -> conhost.exe probe reported here; an upstream no-window/native-helper change remains necessary for that direct process path.
ShienYou commentedon Aug 3, 2026
I can reproduce this on a newer Codex Desktop build, and I captured an additional process path that may help narrow down the Windows-specific cause.
Environment
OpenAI.Codex_26.727.6591.0_x64__2p2nqsd0c76g0Visible-window evidence
A lightweight monitor recorded a real top-level
WindowsTerminal.exewindow with classCASCADIA_HOSTING_WINDOW_CLASSbecoming visible and, in several cases, becoming the foreground window before focus returned toChatGPT.exe.Observed visible durations were approximately 60–205 ms. During one 14-second interval, the monitor captured at least four flashes (74 ms, 108 ms, 60 ms, and 124 ms). The user visibly observed more rapid consecutive flashes than the poller captured, so this is a lower bound.
The Terminal window title was sometimes:
C:\Windows\System32\tzutil.exeThe focus transition was recorded as:
ChatGPT -> Windows Terminal / CASCADIA_HOSTING_WINDOW_CLASS -> ChatGPTThis interrupts typing.
Correlated process activity
The additional process chains observed around the flashes include:
ChatGPT.exe -> gh.exe -> [nested gh.exe] -> tzutil.exe -> conhost.exeChatGPT.exe -> gh.exe -> git.exe -> git.exeChatGPT.exe -> taskkill.exe -> conhost.exeChatGPT.exe -> powershell.exe -> conhost.exeIn one three-minute capture window, the monitor recorded:
ChatGPT.exe -> gh.exegh.exe -> git.exegh.exe -> tzutil.exeChatGPT.exe -> taskkill.exeChatGPT.exe -> powershell.exeThe Windows Terminal host can be brokered/service-owned, so it is not always a direct descendant of the short-lived command process. The correlation above is based on matching timestamps, the Terminal window title, window class, and foreground transitions.
All observed executables resolved to the expected Microsoft, GitHub CLI, or Git for Windows locations/signatures. This looks like a Codex background-process/console-window handling bug rather than an unknown executable.
I can provide sanitized JSONL capture details if useful.
herrinx commentedon Aug 4, 2026
Independent confirmation on a current Windows Codex Desktop build.
Environment
OpenAI.Codex_26.727.6591.0_x64__2p2nqsd0c76g0DelegationConsoleandDelegationTerminalboth all-zero GUIDs)User-visible behavior
Short-lived black command windows flash repeatedly. The user also observed the flashes while Codex remained open with zero active chats/tasks, independently confirming the idle/background condition reported in #34266.
During an interactive diagnostic, user-reported flashes aligned with new Codex-owned process families. Two same-second examples captured:
The PowerShell commands collected process ID, parent PID, command line, working set, CPU percentage, and process age, then serialized the result as JSON.
A separate 10 ms native process-table sampler subsequently captured these additional Codex-owned chains:
The Git command observed was repository-discovery/status work. This supports the multiple adjacent console-allocation paths described in this issue and #34266, rather than a third-party startup utility.
Installed-code check
Read-only inspection of the packaged
app.asarfound the exact WMI snapshot commands. The Electron/NodeexecFilecalls already specifywindowsHide: true, yet transientconhost.exechildren are still created and the flashes remain user-visible. This suggests the current regression may involve more than simply adding-NoProfile -NonInteractive; brokered/default-terminal behavior or another child-process path may also be involved.A hidden native watcher remains active to distinguish a direct
conhost.exesurface from a brokeredWindowsTerminal.exe/CASCADIA_HOSTING_WINDOW_CLASSsurface on the next observed flash.This evidence is sanitized: no account identifiers, task/thread contents, machine name, repository names, or user paths are included.
RonnieBalle commentedon Sep 21, 2026
Windows desktop app intermittently flashes a console window during idle GitHub polling
Summary
The Codex experience in the ChatGPT desktop app for Windows intermittently opens a visible Windows Terminal/console window for a fraction of a second and immediately closes it.
This also happens while the app is idle and no Codex tasks are running. Process monitoring shows that the flash is associated with background GitHub CLI activity initiated by
ChatGPT.exe. A nestedgh.exeinvocation startstzutil.exe, which receives a console host; Windows then briefly startsOpenConsole.exeandWindowsTerminal.exe.Environment
OpenAI.Codex 26.908.9136.0(x64)12219cbfbcbddde726200.9457, x642.92.02.54.0.windows.1tzutil.exe:10.0.26100.2161Steps to reproduce
The issue is intermittent rather than tied to a simple fixed interval.
Expected behavior
Background Git and GitHub CLI operations should run without creating or showing a console window. The desktop should remain visually undisturbed while Codex is idle.
Actual behavior
A Windows Terminal/console window visibly flashes on screen and immediately closes. This is distracting and can occur even when the user has not started a Codex task.
Captured process timeline
One clean idle reproduction occurred on 2026-09-21 at 06:29:17 local time:
06:29:16.589ChatGPT.exestartsgh.exe06:29:17.819gh.exestarts a nestedgh.exe06:29:17.824gh.exestartstzutil.exe06:29:17.830tzutil.exestarts/receivesconhost.exe06:29:17.898OpenConsole.exe06:29:17.903WindowsTerminal.exe06:29:18.145OpenConsole.exeexits06:29:18.207WindowsTerminal.exeexits06:29:18.533gh.exeexitsThe observed chain was:
The
WindowsTerminal.exeprocess lived for approximately 304 ms, matching the visible flash.Recurrence evidence
During one approximately 21-hour capture:
ChatGPT.exe -> gh.exeprocess starts were observed.gh.exe -> tzutil.exeprocess starts were observed.The reproductions originated from the ChatGPT/Codex desktop process, including the idle reproduction above.
Likely cause
The desktop app appears to launch one or more background GitHub CLI commands without fully suppressing console allocation. A nested GitHub CLI process invokes
tzutil.exe; under the configured Windows console host, this activatesOpenConsole.exe/WindowsTerminal.exeand briefly displays a window.The intermittent nature suggests that only certain GitHub refresh paths or subprocess combinations reach the console-allocation path.
Suggested fix
Launch all non-interactive background Git/GitHub subprocesses—and their nested console utilities—with Windows no-window semantics. For example, ensure the applicable process-creation layer uses
CREATE_NO_WINDOWand does not request a new console for background polling. The suppression needs to cover nestedgh.exe/tzutil.exeinvocations, not only the initial process.It would also be useful to add a Windows regression test that performs an idle GitHub refresh and asserts that no visible top-level console/Windows Terminal window is created.
User impact
The repeated flash is distracting, looks like an unexpected command prompt opening, and gives no indication of what initiated it. More seriously, the console grabs focus and becomes the topmost window. If the user is typing when this happens, approximately 2–3 characters of their input are lost because those keystrokes are redirected away from the application they were using. Because the flash also occurs with no active task, users cannot reliably avoid it except by fully quitting the desktop app.
MaxiMustapic commentedon Nov 7, 2026
I'm experiencing the same issue with ChatGPT/Codex Desktop for Windows.
Affected version: OpenAI.Codex 26.1103.4239.0 (November 2026).
This issue persists after updating from version 26.1029.7803.0.
When Codex agents execute commands across different projects, multiple Windows Terminal/PowerShell console windows appear and repeatedly steal keyboard focus.
This is not just a cosmetic inconvenience.
It effectively prevents me from using my computer for other work while Codex is running.
I've collected process information showing Codex launching PowerShell commands, followed by bursts of multiple OpenConsole.exe processes. Although the exact triggering subprocess is not yet confirmed, the behavior is consistently associated with active agent execution.
The problem occurs across multiple unrelated projects.
Please consider prioritizing this as a high-severity desktop usability bug.
A core benefit of Codex is the ability to delegate development tasks while continuing to work independently. This issue makes that workflow practically impossible.
Background processes should never create visible terminal windows or steal focus from the user's active application.
I can provide screenshots and sanitized process logs if needed.
Thanks!