-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enable Set-Location -LiteralPath to work with folders named "-" and "+" #8089
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
Enable Set-Location -LiteralPath to work with folders named "-" and "+" #8089
Conversation
bergmeister
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for quickly taking on this task.
src/System.Management.Automation/engine/SessionStateLocationAPIs.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/SessionStateLocationAPIs.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/SessionStateLocationAPIs.cs
Outdated
Show resolved
Hide resolved
…Is.cs Co-Authored-By: SteveL-MSFT <slee@microsoft.com>
…Is.cs Co-Authored-By: SteveL-MSFT <slee@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for the PR. Should this work too?
Set-Location -Path `+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Escaping happens outside of this PR and this will continue to work
anmenaga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a [feature] test pass for this.
d62c671 to
39165c8
Compare
PR Summary
#7206 added the ability to use
cd -andcd +to navigate through location history. However, it prevented navigating to folders literally named "-" and "+". The internalsetlocation()api doesn't differentiate literal and non-literal paths so fix is to overload it with a flag to indicate path is literal so it doesn't process "-" and "+" as shortcuts.Fix #8086
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests