New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken tab-completion with file or directory names with spaces in the context of tilde-prefixed paths (~
)
#20851
Comments
@237dmitry, yes that's the related bug linked to in the initial post (#20754).
Neither, because - unlike on Windows - there is no such a thing as a process command line on Unix-like platforms, only an array of verbatim arguments (in the case at hand, it is the value of |
I understand that some (or all) Unix shells have this behavior so I can understand why people would want it to be consistent across the different shells. However, in my eyes the desired behavior seems a bit weird. To me a string is a string, it doesn't matter if you use single quotes, double quotes or no quotes at all, as long as you use whatever escape rules apply to the string type during assignment you are golden. |
@MartinGC94, yes, the distinction should not and does not matter in PowerShell, but PowerShell's emulation of both the tilde expansion and pathname expansion (globbing) when calling external programs on Unix of necessity already does make this distinction: E.g. Similarly, The point of this issue is that if the filename you're tab-completing happens to contain spaces, you end up with a broken command, because the completion quotes the whole argument and therefore deactivates tilde expansion. (Fixing tab-completion alone isn't enough, however, because even a properly specified / completed argument with spaces, say |
Yes, it is somewhat awkward from a PowerShell perspective, but it is unavoidable when worlds collide, as happens when a different shell's features are emulated. The emulation - sensibly - only applies to external programs, given that PowerShell commands do their own expansion of If the quoting distinction weren't made, there'd be no way to pass a verbatim I see that |
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
The text was updated successfully, but these errors were encountered: