mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 05:45:49 +03:00
[GH-ISSUE #161] Incorrect rendering of Emojis with Zero-Width-Join characters #129
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bcongdon on GitHub (Sep 1, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/161
It seems that some emojis sequences with zero-width-join runes are unable to be rendered correctly.
For example, with the List view:
These emojis are rendered as their component emojis, instead of the full emoji sequence.

I've double checked that this is not a problem with my terminal emulator, as using the native
fmt.Printlnfunction on these emojis renders them correctly.I've also noticed this behavior with the Table view, so I would suspect that this behavior is present in other views as well.
@rivo commented on GitHub (Sep 5, 2018):
Thanks for spotting this. Approximately 90% of my work on
tviewis spent on making Unicode characters work properly. I thought I had solved it but there are obviously still issues.I'll look into this. Might take me some time if I find there's no simple fix.
@rivo commented on GitHub (Sep 5, 2018):
Looking into this some more, I found that I can't solve this without the help of
tcellandrunewidth(see referenced issues). Both of these packages seem to have issues with unicode sequences containing zero-width joiners.Once support for ZWJs is implemented in these packages, I can fix it in
tviewas well. I hope that the maintainers will add support for ZWJ.@rivo commented on GitHub (Sep 25, 2018):
I just added support for zero-width joiners in
tview. Note that the width of these characters will still be wrong. Once @mattn fixes mattn/go-runewidth#20, this should go away.@bcongdon commented on GitHub (Sep 26, 2018):
Thanks, I appreciate you fixing this!