You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CompleteInput support use the same dir separator as the input param on Windows #2219 #19527
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.
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
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
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:
Default (The current implementation)
LastUsed (Use whichever slash appears last in the input text)
Slash (Always use forward slash)
Backslash (Always use backslash)
Reacted by Michael Klement, Alan Guedes, Aaron Franke, Mr Beedell, Roke Julian Lockhart, Nafid Enan, Paul DiMaggio, Sune Foldager and Maverickx0
Reacted by Alan Guedes, Nafid Enan, on-core and Stefano Figura
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.
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.
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.
Reacted by Alan Guedes, Paul DiMaggio and Maverickx0
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.
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 .
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 :)
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.
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.
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 \ ...
Activity
[-] 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 [/+][-] 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 [/+]MartinGC94 commentedon Apr 18, 2023
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:
ryan-beesley commentedon Apr 19, 2023
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.
alanlivio commentedon Jun 20, 2023
Hi MartinGC94, any update on the PR? Thanks.
MartinGC94 commentedon Jun 20, 2023
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.
alanlivio commentedon Oct 24, 2023
Hi, again MartinGC94. It seems that your PR has been closed.
MartinGC94 commentedon Oct 24, 2023
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.
cyanite commentedon Feb 8, 2024
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:
and press tab, it gets completed to
which doesn't work in less:
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.
alanlivio commentedon Feb 8, 2024
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 .
cyanite commentedon Feb 9, 2024
Right. For me, the most important would be if I could tell it to always complete with /. But any variant will do :)
dyskos commentedon Apr 15, 2024
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:
but the auto-complete changes it to:
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.
alanlivio commentedon Apr 16, 2024
Thanks DyskOS (@dyskos). I am really looking forward to that as well.
Xiphoseer commentedon Jul 21, 2025
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.
alanlivio commentedon Aug 21, 2025
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.