visualize/tab-completion with forward slash as separator on Windows · Issue #2219 · PowerShell/PSReadLine · GitHub
Skip to content

visualize/tab-completion with forward slash as separator on Windows #2219

Closed

Description

Description of the new feature/enhancement

I'm beginning user in PSREadLine and would like to use more a Unix-like behavior inside PowerShell on Windows.
Two things come to my mind to extends PSReadLine:

  1. Visualize slash as separator. For instance, I would like to configure PSReadLine to show the local directory indication as
    PS /Users/alan> instead of PS C:\Users\alan>

  2. Enable tab-completion using forward slash. Today when using tab-completion the forward slash is converted to slash. For instance, ls /Users/ followed by tab is automatic converted to C:\Users

Thanks in advance for any feedback.

Activity

  1. ghost added
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Feb 15, 2021
  2. daxian-dbw commented on Feb 15, 2021

    @daxian-dbw
    Member

    Alan Guedes (@alanlivio) Thanks for your comments. Those behavior are by design, when using PowerShell on Linux, PSReadLine will naturally use forward slash as the path separator.

  3. ghost removed
    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.
    on Feb 15, 2021
  4. alanlivio commented on Feb 15, 2021

    @alanlivio
    Author

    Thank you Dongbo Wang (@daxian-dbw). I edited my comment to make clear that I was talking about running PowerShell on Windows.
    Is there a way to enable that in PSReadLine on Windows?

  5. changed the title [-]visualize/tab-completion with forward slash as separator[/-] [+]visualize/tab-completion with forward slash as separator on Windows[/+] on Feb 15, 2021
  6. jd1378 commented on Jan 23, 2023

    @jd1378

    well, no offense, but the design sucks
    why not provide an option to let us decide ?
    this feature is really one of the main reasons I hate using powershell
    imagine you have a bash script and you want to execute it in wsl, and you are on windows
    you start typing bash press_some_letters<press_tab> and you end up with a path thats not gonna work inside wsl :)

  7. 3N4N commented on Jan 30, 2023

    @3N4N
    Contributor

    javad mnjd (@jd1378) Alan Guedes (@alanlivio) I looked into the code and there is no way, at least no simple way, to use unix-directory-separator in PSReadLine. There is a place that appends a directory separator, and that's patchable, but that only changes the last directory separator, not the preceding ones. The preceding separators are decided here:

    CompleteInput is a PowerShell builtin method, unalterable. And the value it returns is of type CommandCompletion, which is readonly, so you can't even manually edit it after its creation. In other words, there is no simple way to patch PSReadLine so it uses unix directory separator in Windows.

    Dongbo Wang (@daxian-dbw) could you care to verify my observations?

  8. alanlivio commented on Feb 3, 2023

    @alanlivio
    Author

    Many thanks javad mnjd (@jd1378). It will be nice if Dongbo Wang (@daxian-dbw) can confirm if is possible.

  9. daxian-dbw commented on Feb 6, 2023

    @daxian-dbw
    Member

    Sorry for the late response. Nafid Enan (@3N4N) was right, the completion results for path are returned from the tab completion APIs in PowerShell engine, not generated by PSReadLine. So, the ask should better post in the PowerShell repo.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions