Skip to content

fix #113750 - #113840

Merged
Alex Ross (alexr00) merged 6 commits into
microsoft:masterfrom
jonamat:fix#113750
Jan 18, 2021
Merged

Alex Ross (alexr00) merged 6 commits into
microsoft:masterfrom
jonamat:fix#113750

Conversation

@jonamat

Copy link
Copy Markdown
Contributor

This PR fixes #113750

I've wrapped the script names in quotes in all calls to createTask and inside startDebugging.
I'm not familiar with vscode oss so I'm not sure about the side effects of this fix but it seems to work

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment thread extensions/npm/src/tasks.ts Resolved
@@ -316,6 +316,9 @@ export async function createTask(context: ExtensionContext, script: NpmTaskDefin

const packageManager = await getPackageManager(context, folder.uri, showWarning);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding quotes only works if you also use ShellQuoting.Strong in this case.

@ghost

Deleted user (ghost) commented Jan 11, 2021 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to use ShellQuoting to get this to work. While switching over to that, I also decided to use args, so that only the argument that needed the ShellQuoting received it.

@alexr00

Copy link
Copy Markdown
Member

Jonathan Mataloni (@jonamat) you just need to take care of #113840 (comment) then I'll merge.

@jonamat

Copy link
Copy Markdown
Contributor Author

Alex Ross (@alexr00) Done.
Wow, this fix involves more stuff than I expected!
Shouldn't the script name be processed in the same way in startDebugging()?
I didn't add the quotes but if I understand correctly this could lead to interpretation problems on some shells.
Thank you for your support, I really appreciate it

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try the debugging from the npm scripts view with a script that includes a space it works just fine. Looks like debug's default for how to handle spaces is good.

@alexr00
Alex Ross (alexr00) merged commit 9441f1c into microsoft:master Jan 18, 2021
@weinand

Copy link
Copy Markdown
Contributor

Yes, debug's "StartDebugging" tries to handle escaping and quoting differences of various shells automatically.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vscode does not run npm script names with whitespaces

3 participants