GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Enable Set-Location -LiteralPath to work with folders named "-" and "+" by SteveL-MSFT · Pull Request #8089 · PowerShell/PowerShell

Conversation

@SteveL-MSFT

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

Uh oh!

There was an error while loading. Please reload this page.

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

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • User-facing Documentation needed
      • Issue filed - Issue link:
  • Testing - New and feature
    • Not Applicable or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vexx32 and bergmeister reacted with thumbs up emoji vexx32 reacted with hooray emoji
All reactions
  • 👍 2 reactions
  • 🎉 1 reaction
@SteveL-MSFT
enable set-location -literalpath to work with folders named "-" and "+"
9f475a7
@SteveL-MSFT Steve Lee (SteveL-MSFT) assigned Ilya (iSazonov) Oct 20, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested review from Bruce Payette (BrucePay) and Andrew (anmenaga) October 20, 2018 02:16
@SteveL-MSFT
Steve Lee (SteveL-MSFT) requested review from Aditya Patwardhan (adityapatwardhan) and Dongbo Wang (daxian-dbw) as code owners October 20, 2018 02:16
bergmeister
Christoph Bergmeister (bergmeister) approved these changes Oct 20, 2018
View reviewed changes

@bergmeister Christoph Bergmeister (bergmeister) left a comment

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
iSazonov
Ilya (iSazonov) reviewed Oct 20, 2018
View reviewed changes
Comment thread src/System.Management.Automation/engine/SessionStateLocationAPIs.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/engine/SessionStateLocationAPIs.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/engine/SessionStateLocationAPIs.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/engine/SessionStateLocationAPIs.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Ilya (iSazonov) and others added 2 commits October 22, 2018 00:58
@iSazonov @SteveL-MSFT
Update src/System.Management.Automation/engine/SessionStateLocationAP…
139600a
…Is.cs

Co-Authored-By: SteveL-MSFT <[email protected]>
@iSazonov @SteveL-MSFT
Update src/System.Management.Automation/engine/SessionStateLocationAP…
3361fe0
…Is.cs

Co-Authored-By: SteveL-MSFT <[email protected]>
iSazonov
Ilya (iSazonov) reviewed Oct 21, 2018
View reviewed changes
Comment thread test/powershell/Modules/Microsoft.PowerShell.Management/Set-Location.Tests.ps1 Outdated

@iSazonov Ilya (iSazonov) Oct 21, 2018

Copy link
Copy Markdown
Collaborator

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SteveL-MSFT Steve Lee (SteveL-MSFT) Oct 22, 2018

Copy link
Copy Markdown
Member Author

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

iSazonov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
iSazonov
Ilya (iSazonov) approved these changes Oct 21, 2018
View reviewed changes
anmenaga
Andrew (anmenaga) approved these changes Oct 23, 2018
View reviewed changes

@anmenaga Andrew (anmenaga) left a comment

Copy link
Copy Markdown

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@SteveL-MSFT
[feature]
39165c8
address codefactor issues
@SteveL-MSFT
Steve Lee (SteveL-MSFT) force-pushed the set-location-literalpath branch from d62c671 to 39165c8 Compare October 23, 2018 22:07
@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
@SteveL-MSFT @iSazonov
Enable Set-Location -LiteralPath to work with folders named "-" and "…
39892ba
…+" (PowerShell#8089)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iSazonov Ilya (iSazonov) iSazonov approved these changes
@BrucePay Bruce Payette (BrucePay) Awaiting requested review from BrucePay
@adityapatwardhan Aditya Patwardhan (adityapatwardhan) Awaiting requested review from adityapatwardhan
@daxian-dbw Dongbo Wang (daxian-dbw) Awaiting requested review from daxian-dbw
+2 more reviewers
@bergmeister Christoph Bergmeister (bergmeister) bergmeister approved these changes
@anmenaga Andrew (anmenaga) anmenaga approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@iSazonov Ilya (iSazonov)

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@SteveL-MSFT @bergmeister @anmenaga @iSazonov
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.