-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Fix tilde expansion to handle implicit quotes due to escaped whitespace #21277
base: master
Are you sure you want to change the base?
Conversation
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
1 similar comment
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
c777126
to
9abb573
Compare
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just 1 comment (question)
@@ -287,11 +287,10 @@ private void AppendOneNativeArgument(ExecutionContext context, CommandParameterI | |||
if (NeedQuotes(arg)) | |||
{ | |||
_arguments.Append('"'); | |||
AddToArgumentList(parameter, arg); | |||
PossiblyGlobArg(arg, parameter, usedQuotes: false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since everything is going to be possibly globbed, we may get some additional globbing (such as expanded wildcards and variable resolution). That may be a good thing, but it may be more aggressive than we want. should we be checking explicitly for the ~
before passing it to the globber?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the lack of globbing was a bug previously as something like:
1 > "hello world.txt"
ls hello` world.txt
ls hello` world*
The first ls
works as expected as the native command parameter binder recognizes it needs quotes due to the escaped whitespace. The second case doesn't do globbing which it should and this PR also fixes that.
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
1 similar comment
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
PR Summary
This affects with Windows and non-Windows so not directly related to the tilde expansion experimental feature. The code logic doesn't apply the tilde expansion if there are implicit quotes (meaning escaped whitespace). The fix is to re-use the possible globbing helper which does the tilde expansion within this code path.
Note that in Windows case, the quotes are expected while on non-Windows they don't have the quotes and this is how
echo
works differently on the two systems:cmd /c echo "a b"
will echo"a b"
, but/bin/echo "a b"
will echoa b
.PR Context
Fix #21276
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).