Prerequisites
Steps to reproduce
Note:
The solution is the same on both platforms: preserve the unquoted status of an initial ~ if specified as such.
$null = New-Item -Force "$HOME/a test"
(TabExpansion2 'code ~/a').CompletionMatches[0].CompletionText
(TabExpansion2 'code ~/''a').CompletionMatches[0].CompletionText
(TabExpansion2 'code ~/"a').CompletionMatches[0].CompletionText
# Remove-Item "$HOME/a test" # clean up
Related:
Expected behavior
~/'a test'
~/'a test'
~/"a test"
That is, the unquoted status of the initial ~ should be preserved.
Actual behavior
'~/a test'
'~/a test'
'~/a test'
That is, all expansions resulted in inappropriate quoting in that the previously unquoted ~ - required to trigger PowerShell's tilde-expansion emulation when calling external programs - is now quoted.
Error details
No response
Environment data
PowerShell 7.4.0 on Unix-like platforms.
Visuals
No response
Prerequisites
Steps to reproduce
Note:
Currently, the problem only affects Unix-like platforms, because only there is the emulation of tilde expansion for native programs implemented.
However, once Add tilde expansion for windows native executables #20402 is merged, it'll affect Windows too.
The solution is the same on both platforms: preserve the unquoted status of an initial
~if specified as such.Related:
Expected behavior
That is, the unquoted status of the initial
~should be preserved.Actual behavior
That is, all expansions resulted in inappropriate quoting in that the previously unquoted
~- required to trigger PowerShell's tilde-expansion emulation when calling external programs - is now quoted.Error details
No response
Environment data
Visuals
No response