Support mouse event handling for seamless cursor movement in TUI

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

I'm looking to add mouse event handling support to the Codex CLI's TUI, enabling seamless cursor movement by clicking directly within the TUI interface—this aligns with the click-to-move cursor in shell prompts feature introduced in Ghostty 1.3.0 (and similar modern terminal emulators that support OSC 133  click-events / cl=line  extensions or Kitty's  click_events ).

Currently, the Codex TUI relies solely on keyboard input for cursor navigation. Adding mouse support would significantly improve the user experience, especially in modern terminal emulators that natively support mouse-based cursor control for shell prompts/TUIs (e.g., Ghostty, Kitty).

Use Case

Users running Codex CLI in terminals with mouse event support (like Ghostty 1.3.0+) should be able to click anywhere in the Codex TUI to move the cursor directly to that position, just like interacting with a native text field or supported shell prompts (Fish 4.1+, Nushell 0.111+ in Ghostty).

Reference

Ghostty 1.3.0 click-to-move cursor feature documentation:
https://ghostty.org/docs/install/release-notes/1-3-0#click-to-move-cursor-in-shell-prompts

This feature leverages OSC 133 Semantic Prompts specification extensions ( click-events ,  cl=line ) and/or Kitty's  click_events  extension—adopting these standards would ensure compatibility with most modern terminals that support mouse-based cursor control.

Request

Implement mouse event handling in the Codex TUI to support:

  1. Click-to-position cursor anywhere in the TUI interface
  2. Compatibility with terminal emulators that support OSC 133  click-events / cl=line  or Kitty's  click_events 
  3. Seamless cursor movement without relying exclusively on keyboard input

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 5 months ago

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

  • #13822

Powered by Codex Action

etraut-openai contributor · 5 months ago

Can you say more about what you mean by "cursor move support"? Are you talking about using certain keybindings to move the cursor?

iwangjie · 5 months ago
Can you say more about what you mean by "cursor move support"? Are you talking about using certain keybindings to move the cursor?

Alright, my apologies, let me clarify the details.

What I mean is, in terminals like Ghostty, can Codex's TUI respond to mouse events and thus support seamless cursor movement?

https://ghostty.org/docs/install/release-notes/1-3-0#click-to-move-cursor-in-shell-prompts

etraut-openai contributor · 4 months ago

This feature request hasn't received enough upvotes, so I'm going to close it.