[PR #4836] [MERGED] Allow Emoji composition to be seen in the TSF TextBlock #25973

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4836
Author: @leonMSFT
Created: 3/7/2020
Status: Merged
Merged: 3/9/2020
Merged by: @undefined

Base: masterHead: dev/lelian/emojicomposition


📝 Commits (1)

  • 502e851 Send TSF input buffer starting from _activeTextStart to the end of the buffer

📊 Changes

1 file changed (+4 additions, -4 deletions)

View changed files

📝 src/cascadia/TerminalControl/TSFInputControl.cpp (+4 -4)

📄 Description

Summary of the Pull Request

Emoji composition was only being shown one letter at a time. This is because of the way I expected CoreTextTextUpdatingEventArgs.Range to be provided to TSFInputControl during composition (for Chinese/Japanese IME). Emoji IME composition gives the StartCaretPosition as the same as EndCaretPosition, unlike how for Chinese/Japanese IME, StartCaretPosition is usually the start of the composition and EndCaretPosition is the latest character in the composition. The solution is to change the _inputBuffer.substr() call to simply grab all of the buffer starting from _activeTextStart. This way I can ensure that I grab all of the "active text", instead of trusting the given args.Range to tell me the active text.

PR Checklist

Validation Steps Performed

Chinese, Japanese, Korean, Emoji composition performed. Emoji selection through pointer also performed.


🔄 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/4836 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 3/7/2020 **Status:** ✅ Merged **Merged:** 3/9/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/lelian/emojicomposition` --- ### 📝 Commits (1) - [`502e851`](https://github.com/microsoft/terminal/commit/502e85120087eb4b04ca9717a1e93bc01f5dd947) Send TSF input buffer starting from _activeTextStart to the end of the buffer ### 📊 Changes **1 file changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TSFInputControl.cpp` (+4 -4) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Emoji composition was only being shown one letter at a time. This is because of the way I expected `CoreTextTextUpdatingEventArgs.Range` to be provided to TSFInputControl during composition (for Chinese/Japanese IME). Emoji IME composition gives the `StartCaretPosition` as the same as `EndCaretPosition`, unlike how for Chinese/Japanese IME, `StartCaretPosition` is usually the start of the composition and `EndCaretPosition` is the latest character in the composition. The solution is to change the `_inputBuffer.substr()` call to simply grab all of the buffer starting from `_activeTextStart`. This way I can ensure that I grab all of the "active text", instead of trusting the given `args.Range` to tell me the active text. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #4828 * [x] CLA signed. * [x] Tests added/passed <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Chinese, Japanese, Korean, Emoji composition performed. Emoji selection through pointer also performed. --- <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:13:02 +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#25973