Skip to content
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

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

Closed
sba923 opened this issue Mar 10, 2024 · 4 comments
Closed

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

sba923 opened this issue Mar 10, 2024 · 4 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase

Comments

@sba923
Copy link

sba923 commented 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 Enable Alt+x to type in Unicode characters PowerShell/PSReadLine#3578 (comment)
  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

@sba923 sba923 added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Mar 10, 2024
Copy link

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.

@sba923 sba923 changed the title Unexpected rendering behavior with Unicode characters Unexpected rendering behavior with U+1xxxx Unicode characters Mar 10, 2024
@elsaco
Copy link

elsaco commented Mar 10, 2024

Alacritty does it also:

wt_16856_1

wt_16856_2

@lhecker
Copy link
Member

lhecker commented 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 lhecker closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@lhecker lhecker added the Resolution-External For issues that are outside this codebase label Mar 12, 2024
@sba923
Copy link
Author

sba923 commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Resolution-External For issues that are outside this codebase
Projects
None yet
Development

No branches or pull requests

3 participants