[Feature Request] Add configurable editor option for Ctrl+G shortcut
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
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/14916
- 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
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:
- Respect
EDITOR/VISUALenvironment variables for Ctrl+G (consistent with Unix conventions) - Add a dedicated setting in
~/.claude/settings.json(e.g.,"promptEditor": "/usr/bin/vim") - 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.
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.
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
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.