-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Fixe arg parsing when one-character argument is followed by ;
#13706
Conversation
';
;
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'd love a test for this in src\cascadia\LocalTests_TerminalApp\CommandlineTest.cpp
, but the LocalTests are kinda finicky to get running so I won't cry if this merges without one.
Would it be ok add them to |
|
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.
(Future improvement:) Looking at _commandDelimiterRegex
, I get the feeling that this code would be a lot more robust if we'd just find(L';')
and check if the preceding character is != L'\\'
.
Yes and no. What if the character before the |
The regex is currently
There's nothing in the regex that would handle such a case. If we handle it, it must be elsewhere or not at all... |
This vaguely worries me, actually. Why are we using a regex to match a character followed by Leonard's right, we should be using a more direct/implementation-specific string parser rather than a regex. It would give us control over exactly when we match and when we "vend". :) |
;
;
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
Changes the way
_addCommandsForArg
determines if the delimiter was at the beginning of the argument so that it accounts for the fact that match includes the last character of the string before it.PR Checklist
Validation Steps Performed
wt -p "u"; nt -p "u"
does not cause an error