-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Needs to input twice to insert a single Chinese symbol #3745
Comments
Same problem here, need to press the corresponding key twice to input one Chinese punctuation. Windows terminal 0.7.3291.0 |
I found an interesting pattern when repro-ing this issue. The double-input behavior can be repro-ed with any character by performing the following:
Based off this behavior, it appears that after entering certain characters (like question mark), WT is in a buggy state which on transition out of that state the character is consumed and not printed. Interesting to note that this is not a problem with the Japanese language package. |
In
|
The actual call to |
Because |
@zadjii-msft If you change this: terminal/src/cascadia/TerminalControl/TSFInputControl.cpp Lines 227 to 228 in 4882917
...into this: _editContext.NotifyFocusLeave();
_editContext.NotifyTextChanged(emptyTextRange, 0, emptyTextRange);
_editContext.NotifyFocusEnter(); ...this issue and #3706 (and others?) should be fixed. 🙂 And #3645 is probably void too, because it seems to work even if you comment this out:
Would you like me to submit a PR tomorrow? |
@lhecker I would love a PR from you 😄 |
Oh I just noticed that |
The first argument to `NotifyTextChanged` incorrectly was `[0,0]` instead of the length of the text to be removed from the `CoreTextEditContext`. Best source of documentation for `NotifyTextChanged`: https://docs.microsoft.com/en-us/windows/uwp/design/input/custom-text-input#overriding-text-updates FYI @DHowett-MSFT (just in case): C++/WinRT uses `winrt::param::hstring` for string parameters which intelligently borrows strings. As such you can simply pass a `std::wstring` to most WinRT methods without the need of having to allocate an intermediate `hstring`. 🙂 ## Validation Steps Performed I followed the reproduction instructions of #3706 and #3745 and ensured the issue doesn't happen anymore. Closes #3645 Closes #3706 Closes #3745
Wait though we're not sure this is fixed, but the others were |
🎉This issue was addressed in #4140, which has now been successfully released as Handy links: |
The problem is still here. Windows terminal v0.8.10091.0 |
Welp the bot got confused here. |
Sorry for your troubles @zadjii-msft. And I'm sorry for causing this confusion. |
## Summary of the Pull Request Currently, while in IME mode, selections with the Emoji/Kaomoji/Symbol Picker (which is brought up with <kbd>win+.</kbd>) are not displayed until the user starts a new composition. This is due to the fact that we hide the TextBlock when we receive a CompositionCompleted event, and we only show the TextBlock when we receive a CompositionStarted event. Input from the picker does not count as a composition, so we were never showing the text box, even if the symbols were thrown into the inputBuffer. In addition, we weren't receiving CompositionStarted events when we expected to. We should be showing the TextBlock when we receive _any_ text, so we should make the TextBlock visible inside of `TextUpdatingHandler`. Furthermore, some really helpful discussion in #3745 around wrapping the `NotifyTextChanged` call with a `NotifyFocusLeave` and a `NotifyFocusEnter` allowed the control to much more consistently determine when a CompositionStarted and a CompositionEnded. I've also went around and replaced casts with saturating casts, and have removed the line that sets the `textBlock.Width()` so that it would automatically set its width. This resolves the issue where while composing a sentence, the textBlock would be too small to contain all the text, so it would be cut off, but the composition is still valid and still able to continue. ## PR Checklist * [x] Closes #4148 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed ## Validation Steps Performed Tested picking emojis, kaomojis, and symbols with numerous different languages.
Actually when I upgraded my system to 10.0.19564.0 preview version, this issue disappeared. |
Thanks for the confirmation! I've also checked on one of my machines running an older version of windows and I can repro, but once I'm on a newer build, it doesn't repro anymore. I've also checked with some other members of the team and they can't repro either, so I'll go ahead and close this one. |
After upgrading Terminal to version 0.10.761.0, the problem also disappears on Windows Version 1909.
|
Environment
Steps to reproduce
shift
+/
to insert a Chinese?
Expected behavior
?
successfully insertedActual behavior
I have to press
shift
+/
twice to insert a single?
Same problem with other Chinese symbols, such as
《
,》
,【
,】
and etc.The text was updated successfully, but these errors were encountered: