feat: support handing off long prompts to external editor via Ctrl+G

Resolved 💬 1 comment Opened Nov 20, 2025 by bmizerany Closed Jan 14, 2026

What feature would you like to see?

Add the ability to hand off the composer to an external text editor
($EDITOR or $VISUAL) for editing long or complex prompts. This
addresses ergonomics issues when prompts grow too large for
comfortable TUI editing.

Motivation

The current TUI composer works well for quick, simple prompts, but
becomes cumbersome when users need to write longer or more complex
instructions. Users may want to:

  • Switch to their preferred text editor for better ergonomics
  • Use their editor's features (search, replace, syntax highlighting,

macros)

  • Start composing in the TUI and switch to an editor if the prompt

grows too long

  • Leverage existing editor configuration and muscle memory

This feature exists in Claude Code (using Ctrl+G), and implementing
it in Codex with the same binding would:

  • Reduce friction for users transitioning from Claude Code to Codex
  • Follow established prior art and user expectations

Proposed Solution

Add a Ctrl+G keybinding that:

  1. Hands off the current composer content to $EDITOR (or $VISUAL)
  2. Allows editing in the external editor
  3. Returns the edited draft to the composer on editor exit
  4. Handles cleanup (trimming final newline that editors often add)
  5. Maintains ergonomics if editor config is unavailable

Related

This is a follow-up to #906 (C-x C-e feature request), which was
closed because it targeted the TypeScript implementation. Per the
maintainer's suggestion in that issue, this request is for the
Rust-based CLI implementation.

Additional information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗