[BUG] Claude should not hijack the mac-os EDITOR env variable.

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
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_

View original on GitHub ↗

4 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18990
  2. https://github.com/anthropics/claude-code/issues/16342
  3. https://github.com/anthropics/claude-code/issues/10891

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

FergusMcMenemie-cnic · 8 months ago

Having reviewed the above, I dont believe my request is a duplicate

gradigit · 7 months ago

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.

bcherny collaborator · 2 months ago

Thanks! Claude Code checks VISUAL before EDITOR, which is the standard convention for exactly this case: set VISUAL to your GUI editor (e.g. bbedit --wait) and leave EDITOR pointing at a terminal editor for everything else, including over SSH. Docs: https://code.claude.com/docs/en/interactive-mode

Closing since VISUAL covers this; let us know if it doesn't work for your setup.

🤖 Generated with Claude Code

Showing cached comments. Read the full discussion on GitHub ↗