codex - 💡(How to fix) Fix Windows Terminal focus events [O/[I are inserted into TUI prompt on 0.134.0

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

13 ok - 1 idle - 0 warn - 0 fail ok

Root Cause

This makes slash commands fail because the control-sequence text becomes part of the command, for example:

Code Example

Codex CLI OpenAI.Codex 0.134.0 winget

---

Codex Doctor v0.134.0 - windows-x86_64
13 ok - 1 idle - 0 warn - 0 fail ok

---

Microsoft Windows [Version 10.0.26200.8457]

---

Microsoft.WindowsTerminal 1.24.11321.0

---

Windows PowerShell 5.1.26100.8457

---

[O[I[O[I[O[I

---

Unrecognized command '/update[O[I[O[I[O[I'

---

codex
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.134.0

Installed via winget:

Codex CLI OpenAI.Codex 0.134.0 winget

codex doctor --summary reports:

Codex Doctor v0.134.0 - windows-x86_64
13 ok - 1 idle - 0 warn - 0 fail ok

What platform is your computer?

Microsoft Windows [Version 10.0.26200.8457]

What terminal emulator and version are you using?

Windows Terminal:

Microsoft.WindowsTerminal 1.24.11321.0

Shell:

Windows PowerShell 5.1.26100.8457

What issue are you seeing?

On Windows Terminal + Windows PowerShell, the Codex TUI prompt inserts raw focus-reporting control sequences into the input buffer whenever the Windows Terminal window loses or regains focus.

When I switch focus between Windows Terminal and another app with the mouse, the prompt receives visible text like:

[O[I[O[I[O[I

These appear to be terminal focus out / focus in events (ESC [ O and ESC [ I) that should be consumed by the TUI instead of being inserted into the prompt.

This makes slash commands fail because the control-sequence text becomes part of the command, for example:

Unrecognized command '/update[O[I[O[I[O[I'

The same failure mode was also observed with Backspace not working while the prompt is in this bad input state.

Steps to reproduce

  1. Open Windows Terminal.

  2. Start Windows PowerShell 5.1.

  3. Run:

    codex
  4. Wait for the Codex TUI prompt to appear.

  5. Click another application so Windows Terminal loses focus.

  6. Click back into Windows Terminal.

  7. Repeat a few times.

Expected behavior

The TUI should consume terminal focus events and not insert [O / [I into the prompt.

Actual behavior

The prompt receives visible [O / [I text every time focus changes, so the input buffer becomes polluted with raw terminal control sequences.

Additional context

This still reproduces after upgrading from codex-cli 0.133.0 to 0.134.0 via winget.

This may be related to the Windows TUI/raw control sequence regressions discussed in #23740, but the specific symptom here is focus-reporting input leakage on 0.134.0.

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…

FAQ

Expected behavior

The TUI should consume terminal focus events and not insert [O / [I into the prompt.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING