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
path completion of unc paths with spaces fails to quote resulting path #7569
Press CTRL-SPACE (<-EDITED) to bring up completion suggestions, which list all the shares on '\\svr\'.
Select a share that contains a space (notice the highlight fails to clear off entries as you move through the list).
Expected behavior
quotes (') should be added around the UNC path which contains characters that need escaped or quoted.
Actual behavior
Immediately you will notice there is no quote characters being inserted into the completion, and this prevents completing the next step in the path.
Side note, Windows PowerShell 5.1 seems to have the same problem with UNC paths, but at least the highlight works correctly.
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.0.3
PSEdition Core
GitCommitId v6.0.3
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
I tested with the Windows edition of 6.0.4 this morning, still the same result. Are you referring to having made any updates to PSReadLine module? No, I have no additions to PowerShell installed, nor upgraded the PSReadLine module.
After much work, I finally got the latest beta of PSReadLine (2.0.0 beta 2 release) to import in to PowerShell Core, and the issue remains with the non-quoting of paths that require quoting, but the highlight no longer sticks to every entry touched.
PowerShell Core specific items like paths, could use to be mentioned in the PSReadLine readme.
Sorry for not noticing this earlier, it also is an issue for other invalid characters as well, in this case, on the hidden share names, C$, E$, F$ ect. Its also a problem if you already had quotes, say CD "\\SVR\" and then complete with a share name with the $, the $ is not escaped. Yes, once past the share portion, sub folders with an invalid character are no longer a problem, including proper escaping of ` and $
At this point it is looking like no escaping ever occurs on the resulting shares made available for completion, past this point, it appears that file names are escaped before being returned.
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commented on Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
Activity
iSazonov commentedon Aug 20, 2018
Carl Morris (@msftrncs) Could you please test with latest build (6.0.4)? Is the problem without PSReadline module?
msftrncs commentedon Aug 20, 2018
I tested with the Windows edition of 6.0.4 this morning, still the same result. Are you referring to having made any updates to PSReadLine module? No, I have no additions to PowerShell installed, nor upgraded the PSReadLine module.
msftrncs commentedon Aug 20, 2018
including a screenshot
iSazonov commentedon Aug 22, 2018
Carl Morris (@msftrncs) Please unload PSReadline module and test.
msftrncs commentedon Aug 22, 2018
After much work, I finally got the latest beta of PSReadLine (2.0.0 beta 2 release) to import in to PowerShell Core, and the issue remains with the non-quoting of paths that require quoting, but the highlight no longer sticks to every entry touched.
PowerShell Core specific items like paths, could use to be mentioned in the PSReadLine readme.
iSazonov commentedon Aug 23, 2018
I can repo with and w/o PSReadline for share names with spaces (not for folder names in shares).
msftrncs commentedon Aug 24, 2018
Sorry for not noticing this earlier, it also is an issue for other invalid characters as well, in this case, on the hidden share names,
C$,E$,F$ect. Its also a problem if you already had quotes, sayCD "\\SVR\"and then complete with a share name with the$, the$is not escaped. Yes, once past the share portion, sub folders with an invalid character are no longer a problem, including proper escaping of`and$msftrncs commentedon Jun 25, 2019
I think I found the source of this, while referencing #9881,
PowerShell/src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs
Lines 4119 to 4142 in 981c990
At this point it is looking like no escaping ever occurs on the resulting shares made available for completion, past this point, it appears that file names are escaped before being returned.
Implement QuoteArgument for all argument completers
Enhance all argument completers
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 16, 2023
This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.
microsoft-github-policy-service commentedon Nov 23, 2023
This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.
microsoft-github-policy-service commentedon Feb 25, 2025
📣 Hey Carl Morris (@msftrncs), how did we do? We would love to hear your feedback with the link below! 🗣️
🔗 https://aka.ms/PSRepoFeedback