Skip to content

Windows: repeated focus-stealing console popups with shared background server enabled #48440

Closed as duplicate

Description

@kimust

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?

  1. Run Codex CLI 0.157.1 on Windows in a Git working directory with the shared background server enabled.
  2. Submit a prompt.
  3. Press Esc to interrupt a response, then submit another prompt.
  4. 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

  1. added
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    app-serverIssues involving app server protocol or interfaces
    on Sep 26, 2026
  2. reopened this on Sep 26, 2026
  3. kimust commented on Sep 26, 2026

    @kimust
    Author

    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.

  4. Chokitus commented on Sep 26, 2026

    @Chokitus

    Had this problem with 0.157.0 and 0.157.1 as well.

  5. Zerosven commented on Sep 27, 2026

    @Zerosven

    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-daemon stops 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 occasional runner 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.

  6. qunnn41 commented on Sep 28, 2026

    @qunnn41

    Additional diagnostic evidence from another affected Windows x64 machine:

    • Separate terminal windows repeatedly appeared and stole focus from the current application while Codex was working. The problem was noticed after upgrading to 0.157.1.
    • Downgrading the global npm CLI to 0.155.1 did not stop the problem. codex --version confirmed 0.155.1.
    • Setting top-level allow_login_shell = false in the global config and restarting the affected session also did not stop it.
    • Process inspection subsequently found a separate daemon still running from %USERPROFILE%\.codex\packages\app-server-daemon\releases\0.157.1-x86_64-pc-windows-msvc\bin\codex.exe, plus codex-code-mode-host.exe from the same release. The daemon package's current junction pointed to that release.
    • The process snapshot showed that daemon launching pwsh.exe, with conhost.exe children. This establishes process ancestry, but we did not capture foreground-window events, so it does not prove which child stole focus.
    • After stopping the 0.157.1 daemon/helper, removing its current junction, 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 --version after a CLI rollback can miss a separately installed, still-running 0.157.1 daemon. Exact root cause remains unconfirmed.

  7. elysoto commented on Sep 29, 2026

    @elysoto

    Can confirm that --no-daemon fixes this issue for me. It is especially obvious when running /review.

  8. etraut-openai commented on Sep 29, 2026

    @etraut-openai
    Contributor

    We're tracking this in #48074, and we're working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions