Skip to content
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 issue where # in path causes the path to resolve incorrectly #750

Merged
merged 4 commits into from
Sep 26, 2018

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Sep 19, 2018

Fixes PowerShell/vscode-powershell#1518 in a second way!

We seemed to be double escaping URIs. I've changed the behaviour and added a battery of tests around Workspace.ResolveFilePath() (that we should add to).

Now a URI like file:///C:/foo/bar#x/baz/ will resolve to C:\foo\bar#x\baz\ and not C:\foo\bar.

@rjmholt
Copy link
Contributor Author

rjmholt commented Sep 19, 2018

Our current testing means we can't test this stuff cross platform btw -- I can't create a file URI with a ? in it, because Windows won't let me.

@rjmholt
Copy link
Contributor Author

rjmholt commented Sep 19, 2018

Still not sure what's causing PowerShell/vscode-powershell#1513 -- I can't reproduce it (even on a Mac)

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

Hoping this fixes allllll the Chinese & special character issues 😎 LGTM!

@@ -11,6 +11,10 @@
using System.Security;
using System.Text;

#if CoreCLR
using System.Runtime.InteropServices;
Copy link
Member

Choose a reason for hiding this comment

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

Is this used anywhere else? If not, maybe get rid of this ifdef and use the full name space below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only used in the one line, but twice. We would need the full namespace on both RuntimeInformation.IsOSPlatform() and OSPlatform.Windows.

I just tried it, and I think the import is less cumbersome.

@rjmholt rjmholt merged commit 834ae3d into PowerShell:master Sep 26, 2018
@rjmholt rjmholt deleted the resolve-path-escaping-fix branch December 12, 2018 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Powershell terminal randomly crashes with "Access to the Path e:\ is denied"
3 participants