ikappas / vscode-composer

PHP Composer for Visual Studio Code
MIT License
24 stars 7 forks source link

Option --working-dir gets added but doesn't handle spaces #24

Open nschurando opened 2 years ago

nschurando commented 2 years ago

Hi,

  1. I haven't specified anything under the "composer.workingPath" option, and yet, when composer is called, the "--working-dir" option gets added. That's a first unexpected behavior.

  2. This becomes a real problem if the directory has spaces, which isn't handled gracefully as seen is the screenshot below. I suppose adding quotes around here should do the trick ? https://github.com/ikappas/vscode-composer/blob/f0e568484ed319ae14bc66db07d40e258d70b257/src/composer/extension.ts#L556

image

Regards,

Nicolas

geoffmyers commented 2 years ago

+1 Please add support for working paths containing spaces.

Jonnaz commented 1 year ago

I have the same issue on Mac it is not escaping spaces so is executing "composer validate --working-dir /Users/name/directory" rather than "composer validate --working-dir /Users/name/directory\ with\ spaces/workingdirectory"

cagatay117 commented 1 year ago

@ikappas in extension.js on line 475 commandArgs.push('--working-dir', "'" + context.workingPath + "'"); instead of commandArgs.push('--working-dir', context.workingPath); Surrounding the path with single quotes eliminates the problem.