[PR #4688] [MERGED] Display Emojis, Kaomojis, and symbols while in IME mode #25893

Open
opened 2026-01-31 09:12:29 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4688
Author: @leonMSFT
Created: 2/21/2020
Status: Merged
Merged: 2/26/2020
Merged by: @undefined

Base: masterHead: dev/lelian/imemadness


📝 Commits (9)

  • be074ed got the text to show up consistently, but now it's rekt in the future
  • 8942294 HOLY SHIT THIS ACTUALLY WORKS LMAO
  • f773e75 just a comment
  • 47e7e19 simplifying
  • 3d6c0e0 moving a calculation into its own variable to make it cleaner
  • 614be48 clapping
  • e63fc0c the clampening
  • 9de8c54 removing textblock width setting to make it automatic
  • 4191be3 renaming function to be big

📊 Changes

3 files changed (+70 additions, -40 deletions)

View changed files

📝 src/cascadia/TerminalControl/TSFInputControl.cpp (+62 -35)
📝 src/cascadia/TerminalControl/TSFInputControl.h (+3 -0)
📝 src/cascadia/WinRTUtils/inc/Utils.h (+5 -5)

📄 Description

Summary of the Pull Request

Currently, while in IME mode, selections with the Emoji/Kaomoji/Symbol Picker (which is brought up with win+.) 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

Validation Steps Performed

Tested picking emojis, kaomojis, and symbols with numerous different languages.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/4688 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 2/21/2020 **Status:** ✅ Merged **Merged:** 2/26/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/lelian/imemadness` --- ### 📝 Commits (9) - [`be074ed`](https://github.com/microsoft/terminal/commit/be074edf816de674b6df8a85299c9981bc5f26e8) got the text to show up consistently, but now it's rekt in the future - [`8942294`](https://github.com/microsoft/terminal/commit/8942294f02069f03914d542a9e283a201703599c) HOLY SHIT THIS ACTUALLY WORKS LMAO - [`f773e75`](https://github.com/microsoft/terminal/commit/f773e75bac8756775889061f6f605976733f9fbb) just a comment - [`47e7e19`](https://github.com/microsoft/terminal/commit/47e7e197b19ad6bc4bd8c4bf0fb8380f1ab467c1) simplifying - [`3d6c0e0`](https://github.com/microsoft/terminal/commit/3d6c0e0bed9bfa9c93f3003fca1d6e3d3ea47e59) moving a calculation into its own variable to make it cleaner - [`614be48`](https://github.com/microsoft/terminal/commit/614be4875e502b09638245d7c531b555e7ef5bdd) clapping - [`e63fc0c`](https://github.com/microsoft/terminal/commit/e63fc0c64b68bd88e58ffb55b5535a3323bf8698) the clampening - [`9de8c54`](https://github.com/microsoft/terminal/commit/9de8c5422ae621eb8298e822ae9a89dae4016644) removing textblock width setting to make it automatic - [`4191be3`](https://github.com/microsoft/terminal/commit/4191be3e05f58d0b4797a7ff2d895bb3480f1788) renaming function to be big ### 📊 Changes **3 files changed** (+70 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TSFInputControl.cpp` (+62 -35) 📝 `src/cascadia/TerminalControl/TSFInputControl.h` (+3 -0) 📝 `src/cascadia/WinRTUtils/inc/Utils.h` (+5 -5) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:12:29 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25893