Skip to content

Option to Autocomplete to POSIX-Style Paths in PowerShell #25132

Open

Description

@JohnCRuf

Summary of the new feature / enhancement

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\.

Proposed technical implementation details (optional)

A simple setting that allows users to choose POSIX-style (forward-slash) autocompletion, perhaps configurable in $PROFILE, would be a valuable addition.

Activity

  1. added
    Issue-Enhancementthe issue is more of a feature request than a bug
    Needs-TriageThe issue is new and needs to be triaged by a work group.
    on Mar 6, 2025
  2. MartinGC94 commented on Mar 6, 2025

    @MartinGC94
    Contributor

    I have a PR for this that is just waiting for a review: #19518

  3. mklement0 commented on Mar 7, 2025

    @mklement0
    Contributor

    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 = $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).

    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 \ ...
  4. JohnCRuf commented on Mar 7, 2025

    @JohnCRuf
    Author
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 bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Interactive-Consolethe console experienceWG-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