Repeated ESC[0 q cursor reset in Codex v0.129.0 causes constant flicker under Emacs Eat
Open 💬 6 comments Opened May 8, 2026 by ivansviatenko
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.129.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.5
What platform is your computer?
Darwin 25.4.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Emacs Eat mode
What issue are you seeing?
Codex CLI v0.129.0 repeatedly emits CSI 0 SP q / ESC[0 q in the TUI.
Under Emacs Eat, this causes constant visible flicker because Eat treats it as
a cursor-style reset. Filtering only ESC[0 q at the Codex/Eat boundary eliminates
the flicker completely; running the same session unpatched flickers constantly.
Codex CLI v0.128.0 did not exhibit this behavior.
What steps can reproduce the bug?
Run Codex CLI under Emacs eat mode.
What is the expected behavior?
_No response_
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Have you observed this behavior with previous versions? I'm trying to determine if this was a recent change or a long-standing issue.
I have not observed this behavior with previous versions.
I encountered a similar issue with codex-cli 0.129.0. The input cursor didn't flicker in the previous version, but it started flickering in the new version. The flickering cursor always disrupts my flow state. My environment is Windows + Windows Terminal, and this issue didn't occur in previous versions. It might be caused by the introduction of this feat: https://github.com/openai/codex/pull/18595
This is annoying. On KDE Konsole, I just get the letter
qprinted on top of the cursor when typing, and then any thinking steps flickers and addsqs in various spots.<img width="463" height="306" alt="Image" src="https://github.com/user-attachments/assets/a4d865f9-8464-476d-9ce5-78c285ba6d06" />
Also similar to #21666
This comment was drafted and posted by Codex running locally on behalf of @leftos. It is not an OpenAI maintainer response.
I investigated this locally against current
openai/codexmainand a patched local build after seeing the same "cursor flashes at the end of the buffer while holding Space" symptom in a terminal host.Findings:
Renderable::cursor_styleandChatComposer::cursor_styleuseSetCursorStyle::DefaultUserShapeas the default, so the TUI emitsESC[0 qon normal frames. That matches this issue and #21666.ESC[0 qalone did not fix my repro. The visible end-of-buffer flicker was also caused bycustom_terminal::Terminal::try_drawleaving the cursor visible while the frame diff is flushed. Duringself.flush(), the diff renderer moves the hardware cursor around to write changed cells. Current code then queues style,Show, and finally moves to the composer cursor position. Some hosts can paint the cursor in that interim state, which looks like the cursor flashing at the last rendered cell / end of buffer.The local fix that eliminated the repro:
Nonemeans do not emit a cursor-style sequence).SteadyBarfor Vim insert mode.Terminaland only emit style changes; reset toDefaultUserShapeonce when leaving a TUI-applied style, not every frame.try_draw, queue cursor hide before flushing frame updates; after the flush, apply style, move to the final frame cursor position, then queue cursor show.restore_commonfrom unconditionally emittingSetCursorStyle::DefaultUserShape;Terminal::dropresets only if Codex previously applied a style override.Validation:
cargo test -p codex-tui cursorcargo clippy -p codex-tui --all-targets -- -D warningscodex-cliand tested the patched binary in Rustling Tulip; holding Space no longer shows the cursor flickering at the end of the buffer.I have a local branch with the patch and tests, but the repository contribution guidance says external PRs are by invitation only, so I am posting the analysis and fix outline here instead of opening an unsolicited PR.