Skip to content

fix: quote editor launch args on Windows to support paths with spaces#1805

Open
D3OXY wants to merge 1 commit intopingdotgg:mainfrom
D3OXY:fix/open-in-editor-spaces-windows
Open

fix: quote editor launch args on Windows to support paths with spaces#1805
D3OXY wants to merge 1 commit intopingdotgg:mainfrom
D3OXY:fix/open-in-editor-spaces-windows

Conversation

@D3OXY
Copy link
Copy Markdown
Contributor

@D3OXY D3OXY commented Apr 7, 2026

Summary

Fixes #1804

"Open in Editor" breaks on Windows when the project path contains spaces (e.g. C:\bug showcase). The editor receives each space-separated word as a separate argument, opening multiple file tabs instead of the project folder.

Root cause: launchDetached in apps/server/src/open.ts uses shell: true on Windows so editor commands are resolved via PATH. When Node's spawn passes args through the shell, unquoted spaces in paths are treated as argument separators.

Fix: Wrap each argument in double quotes on Windows before passing to spawn(), so the shell keeps paths with spaces intact. Non-Windows platforms are unchanged (they don't use shell: true).

Test plan

  • On Windows, create a project at a path with spaces (e.g. C:\Users\test\My Projects\app)
  • Click "Open in Editor" → editor should open the folder, not individual word-tabs
  • Verify paths without spaces still work as before on Windows
  • Verify no behavior change on macOS/Linux

Note

Fix editor launch args quoting on Windows to support paths with spaces

In open.ts, each argument passed to the detached editor process is now wrapped in double quotes when running on Windows, fixing failures when paths contain spaces. Non-Windows behavior is unchanged.

Macroscope summarized 3f993c9.

…aces

On Windows, `launchDetached` uses `shell: true` so that editor commands
are resolved via PATH. However, when the shell parses the concatenated
command string, spaces in file paths are treated as argument separators.
This causes "Open in Editor" to open one tab per word in the path
instead of opening the project folder.

Wrap each argument in double quotes on Windows before passing to
`spawn()` so the shell keeps paths intact.

Fixes pingdotgg#1804
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 7, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8325fcb8-b6f7-4f48-8f90-38eaa6c29a1f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 7, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 7, 2026

Approvability

Verdict: Approved

This is a straightforward, self-contained bug fix that adds proper quoting for Windows paths with spaces when launching editors. The change is limited to a single spawn() call and follows a well-known pattern for Windows shell compatibility.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Open in Editor" fails when project path contains spaces (Windows)

1 participant