Skip to content

fix: quote editor launch args with spaces on Windows#1331

Open
C-W-D-Harshit wants to merge 1 commit intopingdotgg:mainfrom
C-W-D-Harshit:fix/open-in-editor-spaces
Open

fix: quote editor launch args with spaces on Windows#1331
C-W-D-Harshit wants to merge 1 commit intopingdotgg:mainfrom
C-W-D-Harshit:fix/open-in-editor-spaces

Conversation

@C-W-D-Harshit
Copy link

@C-W-D-Harshit C-W-D-Harshit commented Mar 23, 2026

What Changed

Quote arguments containing spaces when launching editors on Windows.

Why

On Windows, spawn uses shell: true to resolve .cmd/.bat editor commands (like code.cmd for VS Code). This causes the shell to split path arguments at spaces, so a path like C:\Users\John Doe\project opens two separate buffers instead of one.

Prior attempts

This PR only quotes args that contain spaces, and only when shell: true (Windows). Non-Windows platforms pass args as arrays and are unaffected.

Fixes #757

Checklist

  • This PR is small and focused
  • I explained what changed and why

On Windows, spawn uses shell mode to resolve .cmd/.bat editor commands.
This causes paths with spaces to be split into multiple arguments.
Quote args containing spaces so the shell treats them as a single value.

Fixes pingdotgg#757
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 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: b095e705-65d5-446e-9a06-f73889d65767

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:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 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.

"openInEditor" does not work if there are spaces in path

1 participant