claude-code - 💡(How to fix) Fix [Bug] Cannot launch local text editor with spaces in application name

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

And when i use keyboard shortcut ctrl + g, Claude Code fails to open the prompt text or plan in the configured text editor with the following error message: 👉 As we can see from the error text, it appears to cut-off the full absolute configured path string now when it encounters an escaped space within the application name of the JSON settings.json EDITOR environment variable path string value, and hence is the likely root cause.

Root Cause

👉 As we can see from the error text, it appears to cut-off the full absolute configured path string now when it encounters an escaped space within the application name of the JSON settings.json EDITOR environment variable path string value, and hence is the likely root cause.

Code Example

"env": {
  "EDITOR": "/Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl --wait",
},

---

Couldn't open Sublime\ — ENOENT: no such file or directory, posix_spawn '/Applications/Sublime\'

---

/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --wait

---

Couldn't open Sublime\ — ENOENT: no such file or directory, posix_spawn '/Applications/Sublime\'
RAW_BUFFERClick to expand / collapse

Bug Description No longer able to open custom configured local text editor with space in application name (e.g. Sublime Text) on MacOS.

My current Claude Code settings.json is setup with the following environment variable(s):

"env": {
  "EDITOR": "/Applications/Sublime\\ Text.app/Contents/SharedSupport/bin/subl --wait",
},

And when i use keyboard shortcut ctrl + g, Claude Code fails to open the prompt text or plan in the configured text editor with the following error message:

Couldn't open Sublime\ — ENOENT: no such file or directory, posix_spawn '/Applications/Sublime\'
<img width="1774" height="616" alt="Image" src="https://github.com/user-attachments/assets/c8c9f504-eb25-48f2-b335-1d74baa64e4e" />

👉 As we can see from the error text, it appears to cut-off the full absolute configured path string now when it encounters an escaped space within the application name of the JSON settings.json EDITOR environment variable path string value, and hence is the likely root cause.


However, I am able to run the raw bash command in a new vanilla terminal tab like so:

/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --wait

It is IMPORTANT to note that this was working for a long while until recent releases. So this is a RECENT regression.


Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.133
  • Feedback ID: 86b515dc-66c0-460c-b542-42c75d7feb88

Errors

Couldn't open Sublime\ — ENOENT: no such file or directory, posix_spawn '/Applications/Sublime\'

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING