-
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
Fix issues with Japanese & Vietnamese IME #13678
Conversation
I wasn't sure whether I should integrate these changes into the changes made in #13677. I guess keeping it seperate has the benefit of being easier to backport if we don't trust the changes in the other PR. 🙂 |
e158d89
to
87a660e
Compare
09fcd4b
to
54fd439
Compare
// completion event and we'll write "xin" to the shell. It now has no input focus and won't know | ||
// about the whitespace. If you then write "chaof", it'll emit another composition completion | ||
// event for "xinchaof" and the resulting output in the shell will finally read "xinxinchaof". | ||
// A composition completion event technically doesn't mean that the completed text is now |
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.
Wow, this one is correct. IME can change the text in the edit control as it sees fit, you can think of something like autocorrection.
So with the current implementation (before this PR), IME will see a big lump of text without any word delimitation (spaces, dot, comma ...) as they're not notified back to TSF, limiting the ability to provide more advanced text edit functionality that IME can provide.
I have a question regarding the text edit field, is the current command line where the user can input text is not considered a text edit field? And only the composition is considered as a text edit field and has text editing events notified back to TSF?
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 have a question regarding the text edit field, is the current command line where the user can input text is not considered a text edit field?
This part is complicated. Right now, we are using an "overlay" text field because we have not connected the command line buffer to the TSF. This is because of how Terminal sees the screen:
0 | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
C | : | \ | > | H | i | . |
All of the input and output goes into the same character grid. Terminal does not know that 3
is part of the prompt, and 4
is part of the user input! If we naively sent all that data to TSF, it would look like the user could edit the C:\>
part.
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.
All of the input and output goes into the same character grid. Terminal does not know that
3
is part of the prompt, and4
is part of the user input! If we naively sent all that data to TSF, it would look like the user could edit theC:\>
part.
I see, thank you.
On another hand, I think that we can probably just pass that to the TSF, since the text modification should be depended on the text cursor position as well. And even if the TSF's input processors think it can change the text, if the application doesn't change the text then the input processors should follow.
This needs a merge or rebase |
54fd439
to
f2534a9
Compare
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.
To some extent, I have to trust this change -- both that it works right and that it feels right. Thank you @kiennq for testing it and reviewing it as well!
(this is a test) @msftbot merge this after #13707 merges |
Hello @zadjii-msft! 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: |
This commit builds directly on the changes made in microsoft#13677 and fixes: * TSF resetting to AlphaNumeric ("ASCII") input mode when pressing enter * Vietnamese IME not composing a new word after pressing whitespace, etc. Closes microsoft#11479 Closes microsoft#13398 ## Validation Steps Performed * Japanese IME (Full-Width Katakana) Typing "saitama" produces "サイタマ" ✅ * Korean IME Typing "gksrmf" produces "한글" ✅ * Vietnamese IME Typing "xin chaof" produces "xin chào" ✅ * Emoji Picker (Win+.) ✅ (cherry picked from commit ed800dc) Service-Card-Id: 84832470 Service-Version: 1.15
This commit builds directly on the changes made in #13677 and fixes:
Closes #11479
Closes #13398
Validation Steps Performed
Typing "saitama" produces "サイタマ" ✅
Typing "gksrmf" produces "한글" ✅
Typing "xin chaof" produces "xin chào" ✅
✅