-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
With versions prior to 7.4.0, pressing Tab to get completion on a path with ~ converted that path into the full path for my home folder.
Type dir ~\down and press Tab:
- In 7.3.9, it will be completed as
dir C:\Users\bradwilson\Downloads\ - In 7.4.0, it will be completed as
dir ~\Downloads\
For built-in commands (like dir), this is fine. For executables, this passes a path with ~ in it, which makes using such paths impossible unless the executable has its own support for mapping ~ to the home folder. For example, if I try to run notepad ~\.config\git\config, it will tell me the path isn't found; if I run notepad C:\Users\bradwilson\.config\git\config, it will open the file appropriately.
This breaks more than a decade of muscle memory expecting ~ to be translated into the correct path, as I've been using PowerShell as my shell since it was called Monad.
This appears to have been purposefully introduced in #19489. I cannot find any way to restore the old behavior short of sticking w/ version 7.3.9.
Expected behavior
PS> TabExpansion2 '~\Downloads' | select -ExpandProperty CompletionMatches
CompletionText ListItemText ResultType ToolTip
-------------- ------------ ---------- -------
C:\Users\bradwilson\Downloads Downloads ProviderContainer C:\Users\bradwilson\DownloadsActual behavior
PS> TabExpansion2 '~\Downloads' | select -ExpandProperty CompletionMatches
CompletionText ListItemText ResultType ToolTip
-------------- ------------ ---------- -------
~\Downloads Downloads ProviderContainer C:\Users\bradwilson\DownloadsError details
No response
Environment data
Name Value
---- -----
PSVersion 7.3.9
PSEdition Core
GitCommitId 7.3.9
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Name Value
---- -----
PSVersion 7.4.0
PSEdition Core
GitCommitId 7.4.0
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0Visuals
No response