Escape sequences such as [105;1:3u are inserted when typing prompts

Open 💬 14 comments Opened Dec 10, 2025 by hkroger
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.66.0

What subscription do you have?

Some enterprise, I don't know exactly

Which model were you using?

gpt-5.1-codex-max

What platform is your computer?

Darwin 25.1.0 arm64 arm

What issue are you seeing?

Sometimes while typing, different escape sequences appear in the prompt.

For example [105;1:3u but also many others.

What steps can reproduce the bug?

This does not happen always, so this is a bit tricky to reproduce.

What is the expected behavior?

No escape sequences like the one mentioned above apprear in the prompts.

Additional information

I'm using iTerm2 Build 3.6.6 as a terminal emulator.

echo $TERM outputs xterm-256color.

This is very similar to bug reported in #2572

View original on GitHub ↗

14 Comments

hkroger · 7 months ago

Example of what's happening:
<img width="922" height="152" alt="Image" src="https://github.com/user-attachments/assets/62baf483-2bf3-494c-9f09-b2fb71671798" />

Slightly annoying that the execution breaks because something is causing those weird signals.

hkroger · 7 months ago

Actually changing "Apps can report how keys are reported" option doesn't change anything. It was just a coincidence.

amake · 7 months ago

I'm getting this in macOS's Terminal.app when changing focus to and from the app.

When Terminal loses focus it inputs [O. When clicking on Terminal to focus it, it inputs [O or sometimes [I.

I am using local gpt-oss (Ollama) as my model.

jnardiello · 6 months ago

Having exactly the same issue. It is making my usage of codex extremely miserable.

anowardear062-svg · 6 months ago

Support and proses earnings

tschellenbach · 6 months ago

codex is unusuable compared to cursor or claude due to this bug.

etraut-openai contributor · 6 months ago

@tschellenbach, do you have a reliable repro? If so, please share. We've struggled to repro this bug.

fcoury contributor · 5 months ago
I'm getting this in macOS's Terminal.app when changing focus to and from the app. When Terminal loses focus it inputs [O. When clicking on Terminal to focus it, it inputs [O or sometimes [I. I am using local gpt-oss (Ollama) as my model.

@amake @jnardiello @hkroger can you send me the output of this command on the terminal (assuming Linux or macOS):

env | grep -E '^(TERM|TERM_PROGRAM|TERM_PROGRAM_VERSION|COLORTERM|LANG|LC_ALL|LC_CTYPE|SHELL|TMUX|STY|ZELLIJ|KITTY_|WEZTERM_|WT_SESSION|VSCODE_|SSH_)'
amake · 5 months ago
TERM=xterm-256color
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.4G2ySx5pOd/Listeners
TERM_PROGRAM=Apple_Terminal
TERM_PROGRAM_VERSION=455.1
TERM_SESSION_ID=2BC633C0-007B-470F-94DA-6E4B8881AAF5
SHELL=/bin/zsh
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LC_CTYPE=UTF-8
fcoury contributor · 5 months ago

@amake much appreciated. I will try to replicate it here. I assume it still happens with the latest version of Codex (v0.104.0) correct?

amake · 5 months ago
it still happens with the latest version of Codex (v0.104.0) correct?

Yes. However I should add that it seems there is some sort of terminal state involved, because a fresh terminal did not exhibit the issue while a terminal I had used for a variety of other tasks did.

Unfortunately I don't know enough about what kinds of state a terminal or shell can keep. If there's a good command for surfacing that then I would be happy to supply the output.

fcoury contributor · 5 months ago
Yes. However I should add that it seems there is some sort of terminal state involved, because a fresh terminal did not exhibit the issue while a terminal I had used for a variety of other tasks did.

This is good information. Also from your Terminal.app version I assume you are running macOS 15 (Sequoia) right?

amake · 5 months ago
you are running macOS 15 (Sequoia) right?

Correct.

adamgranted · 3 months ago

Seeing this behavior as well but only with the --dangerously-bypass-approvals-and-sandbox session flag. Standard codex sessions have been fine for months.

Currently using codex-cli 0.117.0

TERM_SESSION_ID=w3t1p0:2DE23B56-4E2A-470D-BB2B-8031E6F057E9
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.s20wqfQotJ/Listeners
LANG=en_US.UTF-8
SHELL=/bin/zsh
TERM_FEATURES=T3LrMSc7UUw9Ts3BFGsSyHNoSxFP
TERM_PROGRAM_VERSION=3.6.8
TERM_PROGRAM=iTerm.app
COLORTERM=truecolor
TERM=xterm-256color
TERMINFO_DIRS=/Applications/iTerm.app/Contents/Resources/terminfo:/usr/share/terminfo