Skip to content

Conversation

@funct7
Copy link

@funct7 funct7 commented Jan 28, 2026

Related issues

Proposed Changes

  • Work around PM2 treating space-containing script paths as shell commands by linking the CLI child script to a space-free path before starting it.

Testing Instructions

    • Run studio site create from a path that includes spaces (e.g., “WP Studio.app”) and confirm the WordPress server starts.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@funct7
Copy link
Author

funct7 commented Jan 28, 2026

I got the Studio app to run properly by applying this same change to {App}/Contents/Resources/cli/main.js.

@ivan-ottinger ivan-ottinger requested a review from a team January 28, 2026 13:44
@bcotrim
Copy link
Contributor

bcotrim commented Jan 28, 2026

Hey @funct7, welcome to the project and thanks for your first contribution! 🎉

Great find on the PM2 space-handling issue. Your analysis seems correct and PM2 incorrectly treats paths with spaces as shell commands.

Your fix looks good, but I'd suggest another approach: we already patch PM2 for type fixes (cli/patches/pm2+6.0.14.patch), so we can fix the root cause directly in lib/Common.js with a one-line change:

  // Line 726 - add fs.existsSync check:
  if (app.script && app.script.indexOf(' ') > -1 && cst.IS_WINDOWS === false && !fs.existsSync(app.script)) {

This way:

  • We fix PM2's bug at the source instead of working around it
  • No need for symlinks/copies at runtime
  • Any future scripts are automatically covered

Let me know if you'd like to update the PR with this approach or if you'd prefer I take it from here. Either way, thanks for tracking this down! 🙏

@funct7
Copy link
Author

funct7 commented Jan 28, 2026

@bcotrim It's probably best if you took over since you seem to know a lot more about the code base.
Let me know how to hand it over to you--close the PR, or change the assignee, etc.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio failing to start local server

2 participants