Fixe arg parsing when one-character argument is followed by ;#13706
Fixe arg parsing when one-character argument is followed by ;#137062 commits merged intomicrosoft:mainfrom
;#13706Conversation
';;
zadjii-msft
left a comment
There was a problem hiding this comment.
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 |
|
|
lhecker
left a comment
There was a problem hiding this comment.
(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
_addCommandsForArgdetermines 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