Fix run active file in terminal on paths with spaces under Windows#65331
Merged
Tyriar merged 5 commits intomicrosoft:masterfrom Dec 27, 2018
nunottlopes:issue
Merged
Fix run active file in terminal on paths with spaces under Windows#65331Tyriar merged 5 commits intomicrosoft:masterfrom nunottlopes:issue
Tyriar merged 5 commits intomicrosoft:masterfrom
nunottlopes:issue
Conversation
| c(this._escapeNonWindowsPath(stdout.trim())); | ||
| }); | ||
| return; | ||
| } else if (hasSpace && (exe.indexOf('powershell') !== -1)) { |
Member
There was a problem hiding this comment.
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') !== -1Also, 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.
Member
There was a problem hiding this comment.
@TylerLeonhardt 👍, you can do a PR for that to get credit for it if you want?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
