Unexpected rendering behavior with U+1xxxx Unicode characters #21374

Closed
opened 2026-01-31 07:42:53 +00:00 by claunia · 4 comments
Owner

Originally created by @sba923 on GitHub (Mar 10, 2024).

Windows Terminal version

1.20.10572.0

Windows build number

10.0.22621.0

Other Software

PowerShell 7.4.1
PSReadLine 2.3.4

Steps to reproduce

  1. Define the PSReadLine chord handler at https://github.com/PowerShell/PSReadLine/issues/3578#issuecomment-1987149796
  2. Enter

'1f369 and hit Alt+x

Expected Behavior

I would expect

image

Actual Behavior

image

The emoji is rendered only after typing a closing '

image

Originally created by @sba923 on GitHub (Mar 10, 2024). ### Windows Terminal version 1.20.10572.0 ### Windows build number 10.0.22621.0 ### Other Software PowerShell 7.4.1 PSReadLine 2.3.4 ### Steps to reproduce 1. Define the PSReadLine chord handler at https://github.com/PowerShell/PSReadLine/issues/3578#issuecomment-1987149796 2. Enter `'1f369` and hit `Alt+x` ### Expected Behavior I would expect ![image](https://github.com/microsoft/terminal/assets/12860484/ee1c464b-6e86-443d-b12b-1dc36dbf23f2) ### Actual Behavior ![image](https://github.com/microsoft/terminal/assets/12860484/6e9690a8-679e-4f29-9879-22f4f3d39cbd) The emoji is rendered only after typing a closing `'` ![image](https://github.com/microsoft/terminal/assets/12860484/70168555-196b-463f-9b37-1aca9866958a)
claunia added the Needs-TriageIssue-BugResolution-External labels 2026-01-31 07:42:53 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 10, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Mar 10, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Unicode characters not rendering correctly (#6136)](https://github.com/microsoft/terminal/issues/6136), similarity score: 0.93 - [Unicode characters not rendering correctly in console (#222)](https://github.com/microsoft/terminal/issues/222), similarity score: 0.86 - [Unicode font rendering problem (#2711)](https://github.com/microsoft/terminal/issues/2711), similarity score: 0.85 - [Inconsistent rendering of characters (#14232)](https://github.com/microsoft/terminal/issues/14232), similarity score: 0.81 - [Unicode characters become ? at input but ok at output (#14894)](https://github.com/microsoft/terminal/issues/14894), similarity score: 0.78 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@elsaco commented on GitHub (Mar 10, 2024):

Alacritty does it also:

wt_16856_1

wt_16856_2

@elsaco commented on GitHub (Mar 10, 2024): Alacritty does it also: ![wt_16856_1](https://github.com/microsoft/terminal/assets/3933920/44828625-ef15-4ec5-a03a-6e6adc7305c8) ![wt_16856_2](https://github.com/microsoft/terminal/assets/3933920/59afc312-6019-41c1-841f-1c3cfd41399c)
Author
Owner

@lhecker commented on GitHub (Mar 12, 2024):

Unfortunately, PSReadLine doesn't support supplementary Unicode planes (= U+1xxxx) to begin with so this cannot be fixed in Windows Terminal. For instance, try pasting 🍩 and then backspace. You'll have to backspace twice, presumably because PowerShell internally sees it as the surrogate pair U+D83C U+DF69 and it doesn't know what a surrogate pair is. But just to be sure, I've debugged your repro test and sure enough, PowerShell sends us a literal "??" string.

It may be worth mentioning that Windows Terminal also has poor Unicode support. While it does support supplementary Unicode planes, it fails to support zero width joiners and marks, which means that emojis right now look like this:
image

The upcoming version 1.21 is planned to fix this and it'll then look like this:
image

@lhecker commented on GitHub (Mar 12, 2024): Unfortunately, PSReadLine doesn't support supplementary Unicode planes (= U+1xxxx) to begin with so this cannot be fixed in Windows Terminal. For instance, try pasting 🍩 and then backspace. You'll have to backspace twice, presumably because PowerShell internally sees it as the surrogate pair U+D83C U+DF69 and it doesn't know what a surrogate pair is. But just to be sure, I've debugged your repro test and sure enough, PowerShell sends us a literal "??" string. It may be worth mentioning that Windows Terminal also has poor Unicode support. While it does support supplementary Unicode planes, it fails to support zero width joiners and marks, which means that emojis right now look like this: ![image](https://github.com/microsoft/terminal/assets/2256941/12ddf852-5dca-488f-b307-29c73acf327a) The upcoming version 1.21 is planned to fix this and it'll then look like this: ![image](https://github.com/microsoft/terminal/assets/2256941/31b6e478-35f7-432a-afff-c659d1fb69d8)
Author
Owner

@sba923 commented on GitHub (Mar 12, 2024):

Thanks for the clarification.

This was triggered by checking out https://github.com/StartAutomating/Emoji.

Probably doable to live with some limitations...

@sba923 commented on GitHub (Mar 12, 2024): Thanks for the clarification. This was triggered by checking out https://github.com/StartAutomating/Emoji. Probably doable to live with some limitations...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21374