codex - 💡(How to fix) Fix bug: mouse pointer flickers (I-beam ↔ arrow) on macOS during terminal title spinner animation [2 comments, 2 participants]

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…
GitHub stats
openai/codex#17102Fetched 2026-04-09 08:02:25
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2closed ×1

On macOS, the mouse pointer rapidly flickers between I-beam and arrow while Codex is in "Working" state. The flicker frequency matches the terminal title spinner update interval (100ms).

Root Cause

The terminal title spinner (added in #15860) writes OSC 2 (set-window-title) every 100ms. On macOS, each NSWindow.title setter call triggers AppKit's invalidateCursorRectsupdateTrackingAreas() cycle, which causes the OS to re-evaluate the mouse pointer shape. This is standard AppKit behavior affecting all macOS terminals (Terminal.app, Ghostty, iTerm2).

Full code path traced through Ghostty source for reference:

OSC 2 → Terminal.setTitle → Surface → SurfaceView.title (@Published)
  → BaseTerminalController.titleDidChange → window.title = ...
  → AppKit: invalidateCursorRects → updateTrackingAreas()
  → macOS re-evaluates cursor shape → pointer flickers

Code Example

OSC 2Terminal.setTitleSurfaceSurfaceView.title (@Published)
BaseTerminalController.titleDidChangewindow.title = ...
AppKit: invalidateCursorRects → updateTrackingAreas()
  → macOS re-evaluates cursor shape → pointer flickers

---

[tui]
animated_terminal_title = false
RAW_BUFFERClick to expand / collapse

Description

On macOS, the mouse pointer rapidly flickers between I-beam and arrow while Codex is in "Working" state. The flicker frequency matches the terminal title spinner update interval (100ms).

Root cause

The terminal title spinner (added in #15860) writes OSC 2 (set-window-title) every 100ms. On macOS, each NSWindow.title setter call triggers AppKit's invalidateCursorRectsupdateTrackingAreas() cycle, which causes the OS to re-evaluate the mouse pointer shape. This is standard AppKit behavior affecting all macOS terminals (Terminal.app, Ghostty, iTerm2).

Full code path traced through Ghostty source for reference:

OSC 2 → Terminal.setTitle → Surface → SurfaceView.title (@Published)
  → BaseTerminalController.titleDidChange → window.title = ...
  → AppKit: invalidateCursorRects → updateTrackingAreas()
  → macOS re-evaluates cursor shape → pointer flickers

Reproduction

  1. macOS (tested on M1 Max, macOS 15.4)
  2. Codex CLI v0.118.0
  3. Any terminal (Terminal.app, Ghostty, iTerm2)
  4. Default config (terminal title with spinner enabled)
  5. Give Codex a task that takes a few seconds (e.g. sleep 10s)
  6. Observe mouse pointer flickering between I-beam and arrow during "Working" state

Proposed fix

Add a tui.animated_terminal_title config option (default: true):

  • When true: existing animated braille spinner behavior (100ms updates)
  • When false: static indicator; title only updates on status changes (Working → Thinking → Done), eliminating the 100ms OSC 2 polling

This is a minimal 3-file, ~22-line change:

  • config/src/types.rs: add animated_terminal_title bool field to Tui struct
  • core/src/config/mod.rs: wire through to runtime Config
  • tui/src/chatwidget/status_surfaces.rs: gate spinner animation + frame scheduling on new config; show static indicator when disabled
[tui]
animated_terminal_title = false

I have a working implementation on a fork branch (h4rk8s:fix/terminal-title-spinner-flicker) tested on macOS with Ghostty and Terminal.app — happy to submit a PR if invited.

Environment

  • Codex CLI: v0.118.0
  • OS: macOS 15.4 (Darwin 25.4.0), M1 Max
  • Terminals tested: Ghostty 1.3.2, Terminal.app, iTerm2

extent analysis

TL;DR

Disable the animated terminal title by setting tui.animated_terminal_title to false in the config to prevent mouse pointer flickering.

Guidance

  • The issue is caused by the terminal title spinner updating every 100ms, triggering AppKit's cursor re-evaluation cycle.
  • To verify the fix, set tui.animated_terminal_title to false and observe if the mouse pointer flickering stops during the "Working" state.
  • The proposed fix involves adding a tui.animated_terminal_title config option and updating the code to gate the spinner animation based on this option.
  • Test the fix with different terminals (e.g., Ghostty, Terminal.app, iTerm2) to ensure the issue is resolved across various environments.

Example

[tui]
animated_terminal_title = false

This config change disables the animated terminal title, replacing it with a static indicator that only updates on status changes.

Notes

The fix is specific to macOS and may not apply to other operating systems. The proposed fix has been tested on a fork branch and is pending submission as a PR.

Recommendation

Apply the workaround by setting tui.animated_terminal_title to false, as this is a simple and effective solution to prevent mouse pointer flickering.

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