Windows Terminal focus events [O/[I are inserted into TUI prompt on 0.134.0

Open 💬 5 comments Opened May 28, 2026 by fancyhub

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:

``powershell
codex
``

  1. Wait for the Codex TUI prompt to appear.
  2. Click another application so Windows Terminal loses focus.
  3. Click back into Windows Terminal.
  4. 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.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗