[BUG] Claude should not hijack the mac-os EDITOR env variable.
Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Workaround ✓ Mentioned in thread ↓
Activity 5 comments · opened Jan 20, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Newbie. I see I am being asked to set the EDITOR env variable to allow integration with my IDE/editor (BBEDIT). However the EDITOR env variable is depended on by hundreds of utils which I would never want to use a GUI editor with, especially when I am ssh-ing into my mac for remote locations.
What Should Happen?
Please use a different variable "CLAUDE_EDITOR" and if it is not set then fall back and look for "EDITOR"
Error Messages/Logs
NONE
Steps to Reproduce
None!
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.1.12
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Having reviewed the above, I dont believe my request is a duplicate
https://github.com/anthropics/claude-code/issues/18990#issuecomment-3940128383
already posted in the other issue but worth repeating here because my tool also resolves this issue:
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.
this also means that you retain your EDITOR env var, solving all your problems!
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.
Thanks! Claude Code checks
VISUALbeforeEDITOR, which is the standard convention for exactly this case: setVISUALto your GUI editor (e.g.bbedit --wait) and leaveEDITORpointing at a terminal editor for everything else, including over SSH. Docs: https://code.claude.com/docs/en/interactive-modeClosing since
VISUALcovers this; let us know if it doesn't work for your setup.🤖 Generated with Claude Code