Skip to content

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

Merged
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
SteveL-MSFT:set-location-literalpath
Oct 24, 2018
Merged

Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
SteveL-MSFT:set-location-literalpath

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Oct 20, 2018 •

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

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.

Ilya (iSazonov) and others added 2 commits October 22, 2018 00:58
…Is.cs

Co-Authored-By: SteveL-MSFT <slee@microsoft.com>
…Is.cs

Co-Authored-By: SteveL-MSFT <slee@microsoft.com>

Copy link
Copy Markdown
Collaborator

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 `+

Copy link
Copy Markdown
Member Author

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 Andrew (anmenaga) left a comment

Copy link
Copy Markdown

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.

address codefactor issues
@iSazonov
Ilya (iSazonov) merged commit 9141b11 into PowerShell:master Oct 24, 2018
@iSazonov Ilya (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
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the set-location-literalpath branch March 10, 2020 21:01
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.

Set-Location -LiteralPath does not treat "-" and "+" as literals.

4 participants