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
Option to Autocomplete to POSIX-Style Paths in PowerShell #25132
As a developer working on cross-platform projects, I often use tools (e.g., GNU Make) that require POSIX-style paths. However, PowerShell's autocomplete function always returns Windows-style paths (with backslashes). For example, when I type make ../o, I would expect it to autocomplete to make ../output/ rather than make ..\output\.
A simple setting that allows users to choose POSIX-style (forward-slash) autocompletion, perhaps configurable in $PROFILE, would be a valuable addition.
Reacted by Michael Klement, Jesse Yurkovich, Greg Wojan and Jan Feld
to your $PROFILE (the linked issue contains a lengthy discussion of the feature you're requesting).
It'll allow you to set $private:PSUseSlash = $true in the global scope in order to use / not only for tab-completion, but also in the paths output by (the wrappers for) Convert-Path, Join-Path and Split-Path; the wrappers for the latter also offer a -UseSlash / -sl switch for ad hoc use of / (the $private: scope limits the effects on said cmdlets to interactive use, so as to avoid potentially breaking third-party code).
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
MartinGC94 commentedon Mar 6, 2025
I have a PR for this that is just waiting for a review: #19518
mklement0 commentedon Mar 7, 2025
For now, as a stopgap, you can add the code in:
to your
$PROFILE(the linked issue contains a lengthy discussion of the feature you're requesting).It'll allow you to set
$private:PSUseSlash = $truein the global scope in order to use/not only for tab-completion, but also in the paths output by (the wrappers for)Convert-Path,Join-PathandSplit-Path; the wrappers for the latter also offer a-UseSlash/-slswitch for ad hoc use of/(the$private:scope limits the effects on said cmdlets to interactive use, so as to avoid potentially breaking third-party code).JohnCRuf commentedon Mar 7, 2025
Thank you MartinGC94 and Michael Klement (@mklement0)!!