★ wanayoo — archive 1999 https://github.com/PowerShell/PowerShell/pull/8089Nouvelle recherche | Portail wanayoo
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

Enable Set-Location -LiteralPath to work with folders named "-" and "+" #8089

Merged
merged 4 commits into from Oct 24, 2018

Conversation

Projects
None yet
4 participants
@SteveL-MSFT
Copy link
Member

commented Oct 20, 2018

PR Summary

#7206 added the ability to use cd - and cd + to navigate through location history. However, it prevented navigating to folders literally named "-" and "+". The internal setlocation() 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

@bergmeister
Copy link
Contributor

left a comment

LGTM, thanks for quickly taking on this task.

iSazonov and others added some commits Oct 21, 2018

Update src/System.Management.Automation/engine/SessionStateLocationAP…
…Is.cs

Co-Authored-By: SteveL-MSFT <slee@microsoft.com>
Update src/System.Management.Automation/engine/SessionStateLocationAP…
…Is.cs

Co-Authored-By: SteveL-MSFT <slee@microsoft.com>
Set-Location $TestDrive
$literalPath = Join-Path $TestDrive $path
New-Item -ItemType Directory -Path $literalPath
Set-Location -LiteralPath $path

This comment has been minimized.

Copy link
@iSazonov

iSazonov Oct 21, 2018

Collaborator

Not for the PR. Should this work too?

Set-Location -Path `+

This comment has been minimized.

Copy link
@SteveL-MSFT

SteveL-MSFT Oct 22, 2018

Author Member

Escaping happens outside of this PR and this will continue to work

@anmenaga
Copy link
Contributor

left a comment

It would be good to have a [feature] test pass for this.

[feature]
address codefactor issues

@SteveL-MSFT SteveL-MSFT force-pushed the SteveL-MSFT:set-location-literalpath branch to 39165c8 Oct 23, 2018

@iSazonov iSazonov merged commit 9141b11 into PowerShell:master Oct 24, 2018

8 checks passed

CodeFactor 46 issues fixed. 3 issues found.
Details
PowerShell-CI-linux #PR-8089-20181023.01 succeeded
Details
PowerShell-CI-macos #PR-8089-20181023.01 succeeded
Details
PowerShell-CI-spelling #PR-8089-20181023.01 succeeded
Details
PowerShell-CI-windows #PR-8089-20181023.01 succeeded
Details
WIP ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla All CLA requirements met.
Details

@iSazonov iSazonov changed the title enable set-location -literalpath to work with folders named "-" and "+" Enable Set-Location -LiteralPath to work with folders named "-" and "+" Oct 24, 2018

adityapatwardhan pushed a commit to adityapatwardhan/PowerShell that referenced this pull request Apr 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.