claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

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

Open kemalasliyuksek opened this issue 10 months ago • 2 comments

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

kemalasliyuksek avatar Jan 05 '26 12:01 kemalasliyuksek

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

github-actions[bot] avatar Jan 05 '26 12:01 github-actions[bot]

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.

j-h-scheufen avatar Jan 18 '26 10:01 j-h-scheufen

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.

gradigit avatar Feb 22 '26 04:02 gradigit

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

bcherny avatar Aug 17 '26 03:08 bcherny

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.

github-actions[bot] avatar Oct 06 '26 14:10 github-actions[bot]