CompleteInput support use the same dir separator as the input param on Windows #2219 · Issue #19527 · PowerShell/PowerShell · GitHub
Skip to content

CompleteInput support use the same dir separator as the input param on Windows #2219  #19527

Open

Description

Summary of the new feature/enhancement

Some time ago I created this issue in PSReadline about using tab-completion using a forward slash in PowerShell running on Windows (to better simulate Unix ). For instance, today the ls C:/Users followed by the tab is automatically converted to C:\Users\. I would expect C:/Users/.

PSReadline team said it couldn't be done because CompleteInput is coded to use the system separator.

Therefore, my feature request is that the CompleteInput return respects the same dir separator used in the input param.

Proposed technical implementation details (optional)

No response

Activity

  1. changed the title [-] CompleteInput support to use the dir separator as the input on Windows #2219 [/-] [+] CompleteInput support use the same dir separator as the input on Windows #2219 [/+] on Apr 18, 2023
  2. changed the title [-] CompleteInput support use the same dir separator as the input on Windows #2219 [/-] [+] CompleteInput support use the same dir separator as the input param on Windows #2219 [/+] on Apr 18, 2023
  3. MartinGC94 commented on Apr 18, 2023

    @MartinGC94
    Contributor

    I am working on adding options to control this behavior (see: #19518 ). Assuming it will get merged with my current ideas, you'll be able to choose between the following options:

    1. Default (The current implementation)
    2. LastUsed (Use whichever slash appears last in the input text)
    3. Slash (Always use forward slash)
    4. Backslash (Always use backslash)
  4. ryan-beesley commented on Apr 19, 2023

    @ryan-beesley

    Alan Guedes (@alanlivio), I found this issue searching for a resolution to this exact scenario. I can think of reasons why this shouldn't be the default for all installations, but it'd make things easier for me if this was an option.

  5. alanlivio commented on Jun 20, 2023

    @alanlivio
    Author

    Hi MartinGC94, any update on the PR? Thanks.

  6. MartinGC94 commented on Jun 20, 2023

    @MartinGC94
    Contributor

    The path settings have been implemented and if you want to try them out you can create a build from my branch. I'm actually just waiting for another PR of mine to get merged: #18955 so I can add those options as well.
    It should be noted that PSReadLine interferes a little with my changes because of the way it auto inserts a separator for directories, see: PowerShell/PSReadLine#3699 so that probably needs to be fixed as well before my changes makes its way into a production build.

    -Edit: My PR has been closed due to inactivity but don't worry, I'll just reopen it when the other PR has been merged so I can finish it.

  7. alanlivio commented on Oct 24, 2023

    @alanlivio
    Author

    Hi, again MartinGC94. It seems that your PR has been closed.

  8. MartinGC94 commented on Oct 24, 2023

    @MartinGC94
    Contributor

    Yeah I know. I'm still waiting on: #18955 to get merged. I could of course just leave that feature out for now and resubmit it as is but I suspect it won't make the PS team merge these changes any faster. It seems like they are not really merging any new community changes at the moment where they are preparing for an official 7.4.0 release.
    My best estimate is that they'll "pick up the slack" in January and start merging old PRs and then hopefully it will make its way into a 7.5.0 preview 1 release.

  9. cyanite commented on Feb 8, 2024

    @cyanite

    Recently, PowerShell, or PSReadLine, stopped expanding ~ to your user profile, which makes the slash issue much worse. Now, if I type a "less" command line (using git's less) like this:

    less ~/somefi
    

    and press tab, it gets completed to

    less ~\somefile.txt
    

    which doesn't work in less:

    ~somefile.txt: No such file or directory
    

    Before, it completed to the full path (with ) which did work. Since I use less constantly, this is a pretty big annoyance. Since I'm very used to typing /, it means I can't use tab completion with (so far) less. While less isn't a Windows tool as such, it does ship with Git for Windows.

  10. alanlivio commented on Feb 8, 2024

    @alanlivio
    Author

    Dear Sune Foldager (@cyanite), I am also very used to typing /.
    The most important thing to me is that the windows will accept the / if you send it. But the PowerShell CompleteInput force used to use the .

  11. cyanite commented on Feb 9, 2024

    @cyanite

    Dear Sune Foldager (@cyanite), I am also very used to typing /. The most important thing to me is that the windows will accept the / if you send it. But the PowerShell CompleteInput force used to use the .

    Right. For me, the most important would be if I could tell it to always complete with /. But any variant will do :)

  12. dyskos commented on Apr 15, 2024

    @dyskos

    I hope #18955 will make it in soon, the autocomplete forcing the use of backslash breaks my use of WSL commands from Windows.

    I'll try to run commands like so:

    lx kak ./client.go # lx is an alias for wsl -e
    

    but the auto-complete changes it to:

    lx kak .\client.go
    

    which breaks how the command is interpreted by WSL and instead of opening the existing file, it opens a new empty text file in the WSL home directory.

    Anytime I use a WSL command in Windows via PowerShell, I have to type the names/paths by hand to circumvent this problem, which is a nuisance to say the least.

  13. alanlivio commented on Apr 16, 2024

    @alanlivio
    Author

    Thanks DyskOS (@dyskos). I am really looking forward to that as well.

  14. added
    KeepOpenThe bot will ignore these and not auto-close
    WG-NeedsReviewNeeds a review by the labeled Working Group
    WG-Enginecore PowerShell engine, interpreter, and runtime
    on Apr 29, 2024
  15. Xiphoseer commented on Jul 21, 2025

    @Xiphoseer

    FWIW I came across this issue because Jest (javascript testing tool) seems to try to detect a path argument from a testcase name by checking whether it has forward slashes, which breaks in PowerShell.

  16. alanlivio commented on Aug 21, 2025

    @alanlivio
    Author

    For the ones looking for a solution until the MartinGC94 MR be accepted, Michael Klement (@mklement0) proposed a profile-based solution at #16671 (comment). I tried and it works.

    GitHub
    Summary of the new feature/enhancement PowerShell aims to be cross-platform, but I have been having many issues operating on paths across both Windows and Linux. I understand the need to support \ ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closeNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Enginecore PowerShell engine, interpreter, and runtimeWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions