codex - 💡(How to fix) Fix Windows Desktop: in-app terminal fails in Windows native mode; WSL terminal opens but errors when closed

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • However, closing the terminal triggers an error dialog.
  • In WSL mode, opening and closing the integrated terminal should be clean and error-free.
  • Closing the terminal panel should only close the terminal session/panel. It should not produce an error, break the thread, or require restarting Codex Desktop.
  1. Observe that Codex Desktop shows an error dialog after terminal close.

Code Example

Agent environment: Windows native
Integrated terminal: sidebar / in-app terminal

---

Agent environment: Windows Subsystem for Linux
Integrated terminal shell: WSL
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.527.31.26

What subscription do you have?

ChatGPT Plus / Pro account (please let me know if the exact plan is needed).

What platform is your computer?

Windows 11 x64 with WSL2 enabled.

What issue are you seeing?

I am seeing two related Codex Desktop integrated-terminal failures on Windows. The behavior differs depending on whether Codex Desktop is configured to run in Windows native mode or WSL mode.

Path 1: Windows native mode

Configuration:

Agent environment: Windows native
Integrated terminal: sidebar / in-app terminal

Actual behavior:

  • The Codex Desktop sidebar / in-app terminal cannot be opened.
  • Clicking the terminal entry/button does not bring up a usable integrated terminal.
  • The chat/thread remains visible, but the built-in terminal panel is unavailable.

Expected behavior:

  • In Windows native mode, the sidebar / in-app terminal should open normally.
  • The integrated terminal should start in the current thread or project working directory and remain independent from the chat thread lifecycle.

Path 2: WSL mode

Configuration:

Agent environment: Windows Subsystem for Linux
Integrated terminal shell: WSL

Actual behavior:

  • The sidebar / in-app terminal can be opened successfully in WSL mode.
  • However, closing the terminal triggers an error dialog.
  • This makes the terminal lifecycle unreliable: WSL mode gets further than Windows native mode, but terminal close/cleanup fails.

Expected behavior:

  • In WSL mode, opening and closing the integrated terminal should be clean and error-free.
  • Closing the terminal panel should only close the terminal session/panel. It should not produce an error, break the thread, or require restarting Codex Desktop.

Screenshot

<img width="824" height="546" alt="Image" src="https://github.com/user-attachments/assets/9fa1d632-d190-4c63-b0d3-495f2765c294" />

What steps can reproduce the bug?

Reproduction A: Windows native terminal cannot open

  1. Open Codex Desktop on Windows.
  2. Configure Codex Desktop to use Windows native mode.
  3. Open or create a thread/project.
  4. Try to open the sidebar / built-in integrated terminal.
  5. Observe that the integrated terminal does not open into a usable terminal session.

Reproduction B: WSL terminal opens but errors on close

  1. Open Codex Desktop on Windows.
  2. Configure Codex Desktop to use WSL mode.
  3. Open or create a thread/project.
  4. Open the sidebar / built-in integrated terminal.
  5. Observe that the terminal opens.
  6. Close the terminal.
  7. Observe that Codex Desktop shows an error dialog after terminal close.

Why I think these are related

Both symptoms are about Codex Desktop's integrated-terminal lifecycle on Windows:

  • Windows native mode fails at terminal startup/open.
  • WSL mode succeeds at terminal startup/open but fails during terminal close/cleanup.

This looks like a Windows Desktop terminal lifecycle issue, possibly involving different code paths for native Windows terminal process spawning and WSL terminal process cleanup.

Related issues

These look adjacent but do not seem to cover this exact two-path behavior:

  • #25175: AttachConsole failed (Most similar issue).
  • #15568: Windows native integrated terminal exit affects thread lifecycle.
  • #18506: Windows + WSL integrated terminal/path handling issues.
  • #12478: Clicking Stop on running terminals in Codex app does not close them.
  • #13756: Terminal panel does not automatically close on shell exit.
  • #23189: Windows + WSL project terminal tries to cd into malformed WindowsApps/\\wsl$ path.
  • #14461: Windows Codex cannot start when WSL mode and terminalShell=wsl are enabled.

Additional information

If helpful, I can provide:

  • the current config.toml desktop settings,
  • Codex Desktop logs around the terminal open/close attempts,
  • the WSL distro name and version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING