Support mouse click to move cursor in TUI input box

Open 💬 4 comments Opened May 20, 2026 by xiaodream551-a11y
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 3 months ago

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

  • #14315

Powered by Codex Action

saarthak314 · 1 month ago

I’ve implemented this locally with tests and verified it in the TUI. It adds left-click cursor positioning inside the composer while ignoring other mouse events. Would a maintainer be open to inviting a PR for this? @etraut-openai

https://github.com/user-attachments/assets/5a9d74f2-096c-425c-9243-096ba8c385b3

vladrudn · 2 days ago

I would really appreciate this feature as well. I frequently work with long prompts in Codex CLI, and repositioning the cursor with arrow keys is significantly slower than simply clicking at the desired position.

+1 for implementing this.

wuhaoyujerry · 1 day ago

This feature has been in claude code and open code for a while now. Would be great if we can have this in codex too.