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

unicode rendering issue with info sign emoji in Windows Terminal #104

Closed
wedaly opened this issue Feb 14, 2022 · 5 comments
Closed

unicode rendering issue with info sign emoji in Windows Terminal #104

wedaly opened this issue Feb 14, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@wedaly
Copy link
Contributor

wedaly commented Feb 14, 2022

Describe the bug
Text gets garbled in a document with a unicode info sign emoji.

To Reproduce
Steps to reproduce the behavior:

  1. Open this document: unicode-render-issue.txt
  2. Move the cursor to one of the first positions and press "D" to delete the rest of the line.
  3. Observe that the text is garbled, with some deleted characters still displayed (see screenshot below).

Expected behavior
Deleted characters should not be displayed.

Screenshots
image

System (please complete the following information):

  • OS: Ubuntu 20.04 running under WLS2 on Windows 11
  • Terminal: Windows Terminal
  • Version: dev @ 8fb65d4

Additional context

  • Saw similar issues a long time ago that was fixed by this change: Interpret "na" as narrow mattn/go-runewidth#44 Maybe something similar is happening here?
  • In longer documents, can reproduce the issue just by scrolling: some characters appear "stuck" in the displayed text.
  • Could not reproduce this in macOS Terminal.app or Fedora gnome-terminal.
  • The issue doesn't happen when opening the same file in vim or using cat to output to the terminal.
@wedaly wedaly added the bug Something isn't working label Feb 14, 2022
@wedaly wedaly changed the title unicode rendering issue with unicode info sign emoji unicode rendering issue with info sign emoji Feb 14, 2022
@wedaly
Copy link
Contributor Author

wedaly commented Feb 15, 2022

Could not reproduce this on macOS Terminal.app

@wedaly
Copy link
Contributor Author

wedaly commented Feb 15, 2022

Cannot reproduce it on Fedora with gnome-terminal either.

@wedaly wedaly changed the title unicode rendering issue with info sign emoji unicode rendering issue with info sign emoji in Windows Terminal Feb 15, 2022
@wedaly
Copy link
Contributor Author

wedaly commented Feb 15, 2022

Seems to be related to variation selector 16 (0xFE0F). Removing that rune from the end of the sequence seems to fix it. It seems like Windows terminal is adding a column for the 0xFE0F character, and I think that's getting the terminal state out-of-sync with tcell's internal representation.

Possibly related: microsoft/terminal#12373

@wedaly
Copy link
Contributor Author

wedaly commented Feb 15, 2022

Closing because I think this will be resolved by active work in Windows Terminal to better support unicode.

@wedaly wedaly closed this as completed Feb 15, 2022
@wedaly
Copy link
Contributor Author

wedaly commented Feb 15, 2022

Made a small change to render emojis with 0xFE0F as two cells. Previously some of them (like the info sign) were being rendered as one cell, but every terminal I tested used two. This doesn't fix the issue in Windows Terminal, but it does improve rendering in other terminals: bdde43d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant