Skip to content

[Bug] Multiple external command prompt windows pop up when running Codex CLI in PyCharm terminal on Windows #49431

Open

Description

@Mht0421

What version of Codex CLI is running?

codex-cli 0.160.0-alpha.3

What subscription do you have?

API

Which model were you using?

gpt-5.2

What platform is your computer?

Windows 10.0.19045 (Windows 10 Pro) [64-bit]

What terminal emulator and version are you using (if applicable)?

PyCharm built-in terminal (PowerShell/CMD). PyCharm version: [2025.3]

Codex doctor report

What issue are you seeing?

On Windows, when I run Codex CLI inside the PyCharm integrated terminal and start a conversation, it repeatedly spawns multiple external command prompt (CMD/PowerShell) popup windows. These extra windows steal focus and seriously interrupt the workflow.

From the codex doctor report, I noticed some critical anomalies:

  1. The terminal is incorrectly identified as "Apple Terminal" on Windows (terminal.env -> terminal: Apple Terminal).
  2. The terminal height is only 16 rows (recommended >= 24), which might trigger unexpected TUI redrawing logic.
  3. The console code page is 936 (GBK), which might cause encoding issues.

What steps can reproduce the bug?

  1. Open PyCharm on Windows.
  2. Open the built-in Terminal (set to PowerShell or CMD).
  3. Run codex to start the CLI.
  4. Initiate a conversation (e.g., type a prompt or let it execute a command).
  5. Observe that multiple external command prompt windows pop up on the screen.

What is the expected behavior?

Codex CLI should run entirely within the PyCharm terminal without spawning any external/separate command prompt windows. Any background command execution should be handled silently or within the same terminal context.

Additional information

The issue might be related to how Codex CLI spawns sub-processes on Windows when the terminal environment is misidentified as "Apple Terminal". It seems to be missing the CREATE_NO_WINDOW flag or equivalent when spawning child processes on Windows under this specific misidentified environment.

Activity

  1. added
    bug
    on Sep 30, 2026
  2. added
    CLI
    windows-os
    on Sep 30, 2026
  3. zdd commented on Sep 30, 2026

    @zdd

    This is simply terrible. You can't input anything on the CLI at all. You guys should fix this problem as soon as possible.

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

    CLIbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions