bug: mouse pointer flickers (I-beam ↔ arrow) on macOS during terminal title spinner animation
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
- macOS (tested on M1 Max, macOS 15.4)
- Codex CLI v0.118.0
- Any terminal (Terminal.app, Ghostty, iTerm2)
- Default config (terminal title with spinner enabled)
- Give Codex a task that takes a few seconds (e.g.
sleep 10s) - 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: addanimated_terminal_titlebool field toTuistructcore/src/config/mod.rs: wire through to runtimeConfigtui/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
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗