[Feature Request] Add configurable editor option for Ctrl+G shortcut

Status Fixed / completed
Reported on v2.0.76
Maintainer reply ✓ Yes — bcherny
Activity 4 comments · opened Jan 5, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
Add an option to configure the editor that opens with Ctrl+G

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.0.76
  • Feedback ID: fe23afc6-53e7-4aa3-acee-0b5654a64ed6

View original on GitHub ↗

4 Comments

github-actions[bot] · 7 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/14916
  2. https://github.com/anthropics/claude-code/issues/9889

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

j-h-scheufen · 7 months ago

Adding detailed context from #18990:

Problem: Ctrl+G auto-detects installed IDEs rather than respecting EDITOR/VISUAL environment variables. With Cursor IDE installed, pressing Ctrl+G launches the full IDE just to edit a few lines of prompt text—extremely heavyweight when I have EDITOR configured to use a lightweight text editor.

Proposed solutions:

  1. Respect EDITOR/VISUAL environment variables for Ctrl+G (consistent with Unix conventions)
  2. Add a dedicated setting in ~/.claude/settings.json (e.g., "promptEditor": "/usr/bin/vim")
  3. Both—use the setting if present, fall back to env vars, then fall back to IDE auto-detection

Use cases:

  • Users with multiple IDEs who want lightweight editors for quick prompt edits
  • Users who prefer terminal-based editors (vim, nano, emacs)
  • Users on resource-constrained systems where launching a full IDE is slow

See #18990 for the full write-up.

gradigit · 6 months ago

https://github.com/anthropics/claude-code/issues/18990#issuecomment-3940128383
already posted in the other issue but worth repeating here:

i managed to build a good solution:
https://github.com/gradigit/claude-pager
by using a shim like claude-pager, you can set ctrl-g to whatever editor you want, and i have it setup so you set it within your claude settings.json intuitively.

i know it's still a shim and a workaround, but claude-pager also resolves the issue of claude code window going blank when you ctrl-g.

as a bonus, because i use ctrl-g a lot, i made a purpose-built prompt editor specifically for ctrl-g, focused purely on performance:
https://github.com/gradigit/turbodraft

now im able to ctrl-g and start typing immediately in ~50ms, with full session context.

bcherny collaborator · 14 days ago

You can already configure this: the Ctrl+G external editor honors your $VISUAL environment variable first, then $EDITOR. For example export VISUAL="code --wait" (or nvim, zed --wait, etc.) in your shell profile, or put it in the env block of your Claude Code settings so it applies only to Claude Code. See https://code.claude.com/docs/en/interactive-mode (the Ctrl+G row) and https://code.claude.com/docs/en/settings#environment-variables

🤖 Generated with Claude Code