Skip to content

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

Closed

Description

From great feature, I would say Navigation is impossible to folder named - and +

image

Set-Location -LiteralPath - as well

Environment data


Name                           Value
----                           -----
PSVersion                      6.2.0-preview.1
PSEdition                      Core
GitCommitId                    6.2.0-preview.1
OS                             Microsoft Windows 10.0.18262 
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Activity

  1. vexx32 commented on Oct 19, 2018

    @vexx32
    Collaborator

    Surely this is accessible with cd .\- and cd .\+?

  2. kvprasoon commented on Oct 19, 2018

    @kvprasoon
    ContributorAuthor

    Rain Sallow (/u/ta11ow) (@vexx32) But that's not how directory navigation should be.

  3. vexx32 commented on Oct 19, 2018

    @vexx32
    Collaborator

    That's an opinion, not a fact. And I'm sure folks accustomed to using cd - and cd + on Linux would disagree there. 😄

  4. kvprasoon commented on Oct 19, 2018

    @kvprasoon
    ContributorAuthor

    Cc Steve Lee (@SteveL-MSFT) , I thought of asking this at your session yesterday @PSConfAsia, but my lappie was not with me...

  5. rkeithhill commented on Oct 19, 2018

    @rkeithhill
    Collaborator

    You have a similar issue with a dir named [foo]. You can cd to it with cd -lp [foo] but the same doesn't work with cd -lp -. I think perhaps that should work in addition to cd .\-.

  6. vexx32 commented on Oct 19, 2018

    @vexx32
    Collaborator

    Yeah, I'd agree that -LiteralPath should not exhibit the history-navigation behaviour for obvious reasons!

  7. added
    Issue-Question
    Resolution-Answered
    on Oct 19, 2018
  8. SteveL-MSFT commented on Oct 20, 2018

    @SteveL-MSFT
    Member

    Set-Location -LiteralPath - should treat it as a literal path and not Pop-Location so that is a bug. We can use this issue to track that.

  9. added
    Issue-Bug
    and removed
    Issue-Question
    on Oct 20, 2018
  10. changed the title [-]Navigation impossible to folder named `-` and `+`[/-] [+]Set-Location -LiteralPath does not treat "-" and "+" as literals.[/+] on Oct 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugResolution-Fixed

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions