New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix run active file in terminal on paths with spaces under Windows #65331

merged 5 commits into from Dec 27, 2018


None yet
3 participants
Copy link

nunottlopes commented Dec 18, 2018

Fixes #62350.

When we run a file on powershell with a path that has a space in it instead of running "c:\Users\matb\folder\sp ace.html" it will now execute & 'c:\Users\matb\folder\sp ace.html'. This way powershell will be able to execute the file as it is pretended.

nunottlopes added some commits Dec 18, 2018

@Tyriar Tyriar changed the title Fix #62350 Fix run active file in terminal on paths with spaces under Windows Dec 27, 2018

@Tyriar Tyriar added this to the December/January 2019 milestone Dec 27, 2018


Tyriar approved these changes Dec 27, 2018

Copy link

Tyriar left a comment


@Tyriar Tyriar merged commit 87ff76a into Microsoft:master Dec 27, 2018

1 of 2 checks passed

VS Code in progress
license/cla All CLA requirements met.
@@ -688,6 +688,8 @@ export class TerminalInstance implements ITerminalInstance {
} else if (hasSpace && (exe.indexOf('powershell') !== -1)) {

This comment has been minimized.


TylerLeonhardt Dec 28, 2018


In the latest version of PowerShell, PowerShell Core (xplat, ships outside of Windows), the executable has been renamed to pwsh to prevent any conflicts with the PowerShell version that ships in Windows, called Windows PowerShell aka powershell.exe.

This fix should also include a check for the latest version of PowerShell as well.

exe.indexOf('powershell') !== -1 || exe.indexOf('pwsh') !== -1

Also, I think this fix only works on Windows, but PowerShell Core works on macOS and Linux.

cc @Tyriar I probably should have called out the executable name in the issue you tagged me in. My bad.

This comment has been minimized.


Tyriar Dec 28, 2018


@TylerLeonhardt 👍, you can do a PR for that to get credit for it if you want?

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