EDITOR environment variable doesn't work with paths containing spaces on Windows
Resolved 💬 3 comments Opened Feb 27, 2026 by Mark-Allen-Neil Closed Mar 3, 2026
Description
On Windows, setting the EDITOR environment variable to a path containing spaces (e.g., C:\Program Files\Notepad++\notepad++.exe) does not work. The /memory command reports it is using the correct editor but fails to launch it.
Steps to Reproduce
- On Windows, set EDITOR in
~/.claude/settings.json:
``json``
"env": {
"EDITOR": "C:\Program Files\Notepad++\notepad++.exe"
}
- Restart Claude Code
- Run
/memory - Output shows
Using $EDITOR="C:/Program Files/Notepad++/notepad++.exe"but the editor does not open
Expected Behavior
The editor should launch with the memory file.
Actual Behavior
The editor is not launched. No error message is shown.
Workaround
Create a wrapper batch file without spaces in the path:
C:\Users\<username>\bin\npp.cmd:
@echo off
"C:\Program Files\Notepad++\notepad++.exe" %*
Then set EDITOR to the wrapper path:
"EDITOR": "C:\Users\<username>\bin\npp.cmd"
Environment
- Windows 10 Enterprise 10.0.19045
- Claude Code (latest)
- Shell: Git Bash
Notes
This appears to be a quoting issue when Claude Code invokes the editor. The path should be properly quoted to handle spaces.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗