Skip to content

Windows: agent PowerShell commands flash console windows and steal focus #48498

Closed as duplicate

Description

@Burjuy

Environment

  • Codex on Windows after a recent update, using PowerShell for agent-run shell commands.
  • Native Windows sandbox is configured as elevated.
  • sandbox_private_desktop is not explicitly disabled in the user config.

Steps to reproduce

  1. Start a Codex session on Windows, minimize the main terminal, and work in another application.
  2. Ask the agent to run a harmless PowerShell command such as Write-Output 'Codex terminal check'.
  3. Observe a terminal window briefly appear over the active application and take keyboard focus. This happens repeatedly as the agent runs commands.
  4. A prompt that does not invoke any command does not produce the popup. The flash can appear immediately after submitting a prompt when the agent's first action is a shell command.

Expected behavior

Non-interactive agent commands should run without creating visible console windows or taking focus from the user's current application, even when the main terminal is minimized.

Actual behavior and impact

Console windows flash above other windows and steal focus. This interrupts typing and makes it difficult to use other applications while Codex works. Please give native Windows and PowerShell workflows closer attention in testing. At this point these disruptions make paying for Codex hard to justify: the tool is causing problems instead of helping solve them.

Related reports about visible Windows consoles: #23892, #48059, and #46949. This report adds the command-triggered reproduction and the observation that focus is stolen even when the main terminal is minimized.

Separate status line reminder

Please also revisit the inability to display the current Git branch and PR number in the status line on affected setups. Related open reports: #23968 (branch) and #23473 (PR number).

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Sep 26, 2026
  2. Cooler2 commented on Sep 26, 2026

    @Cooler2

    Yeah, very annoying. Version downgrading doesn't help. Unusable.

  3. chennqqi commented on Sep 27, 2026

    @chennqqi
    [features]
    daemon_auto_start = false
    

    Can alleviate this problem

  4. winterallen commented on Sep 28, 2026

    @winterallen
    [features]
    daemon_auto_start = false
    

    能缓解这个问题吗?

    [features]
    daemon_auto_start = false
    

    Can alleviate this problem

    no

  5. leike0813 commented on Sep 28, 2026

    @leike0813

    Serious bug, Codex is almost unusable on Windows until this bug is fixed.

  6. etraut-openai commented on Sep 29, 2026

    @etraut-openai
    Contributor

    We're tracking this in #48074, and we're working on a fix. We thought we had it fixed in 0.158.0, but we discovered a few additional code paths that require the same 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 CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-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