[Feature Request] Allow configuring external editor for Ctrl-G prompt editing

Open 💬 4 comments Opened Jan 18, 2026 by j-h-scheufen

Problem

When pressing Ctrl-G to edit a prompt in an external editor, Claude Code auto-detects installed IDEs rather than respecting the standard EDITOR or VISUAL environment variables. On systems with multiple IDEs installed, this leads to undesirable behavior.

My specific case: I have Cursor IDE installed alongside other tools. When I press Ctrl-G to make a quick edit to my prompt, Claude Code launches the full Cursor IDE. This is extremely heavyweight for simply editing a few lines of text—an entire IDE with all its extensions and services starts up just to edit a prompt.

I have configured EDITOR in my shell profile to use a lightweight text editor (macOS TextEdit), but Claude Code ignores this setting.

Current Behavior

  • Ctrl-G auto-detects IDEs in the environment (VS Code, Cursor, etc.)
  • The EDITOR environment variable is only respected for bash subprocesses (e.g., git commit), not for Ctrl-G
  • Users cannot override which editor Ctrl-G opens
  • Related: Issue #12546 reports Claude Code suggesting VS Code even when it's not installed

Requested Behavior

Ctrl-G should respect the EDITOR (or VISUAL) environment variable, or provide a dedicated setting to configure the external editor for prompt editing.

Proposed Solution

Option A: Respect EDITOR/VISUAL environment variables for Ctrl-G (consistent with Unix conventions)

Option B: Add a dedicated setting in ~/.claude/settings.json:

{
  "promptEditor": "/usr/bin/open -e -W -n"
}

Option C: Both—use the setting if present, fall back to EDITOR/VISUAL, then fall back to IDE auto-detection

Use Case

  • Users with multiple IDEs installed who want a lightweight editor for quick prompt edits
  • Users who prefer terminal-based editors (vim, nano, emacs)
  • Users who want consistent behavior with other Unix tools that respect EDITOR
  • Users on resource-constrained systems where launching a full IDE is slow

Related Issues

  • #10891 - Similar request for file editing operations (Edit/Write tools), closed without implementation. This request is distinct: it specifically addresses Ctrl-G prompt editing, not file operations.
  • #12546 - Bug where Claude Code suggests VS Code when it's not installed, indicating issues with IDE detection logic

Environment

  • Claude Code Version: Latest
  • Platform: macOS
  • Shell: zsh with EDITOR configured

Thank you for considering this enhancement.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗