Support mouse click to move cursor in TUI input box
Summary
Add mouse event handling to the Codex CLI's TUI input box so users can click directly to move the cursor, instead of relying on keyboard navigation only.
Background
This was previously requested in #14315, which was closed due to insufficient upvotes. Reopening / re-requesting because the need still stands and modern terminals increasingly support this interaction (Ghostty 1.3.0+, Kitty, WezTerm, etc.).
Use case
When editing a long prompt in the Codex CLI input box, repositioning the cursor with arrow keys / Ctrl+A / Ctrl+E is slow. Clicking the desired position with the mouse — like in any GUI text field or shells such as Fish 4.1+ / Nushell 0.111+ inside Ghostty — would be significantly faster.
Proposal
Enable mouse capture in the TUI and translate click coordinates to cursor positions inside the multiline input widget. Compatible with terminals that support OSC 133 click-events / cl=line or Kitty's click_events.
References
- Previous closed issue: #14315
- Ghostty click-to-move-cursor docs: https://ghostty.org/docs/install/release-notes/1-3-0#click-to-move-cursor-in-shell-prompts
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗