bug: mouse pointer flickers (I-beam ↔ arrow) on macOS during terminal title spinner animation

Resolved 💬 2 comments Opened Apr 8, 2026 by h4rk8s Closed Apr 8, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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 invalidateCursorRects → updateTrackingAreas() 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

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #16332
  • #16008
  • #15938

Powered by Codex Action

h4rk8s · 4 months ago

Closing — this can be worked around with the existing /title command by removing the spinner item from the terminal title configuration. The root cause analysis (AppKit invalidateCursorRects triggered by NSWindow.title updates) remains valid and may be useful if the team decides to address it upstream.