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

Grapheme Clustering (mode 2027) #7799

Closed
aymanbagabas opened this issue Aug 28, 2024 · 1 comment
Closed

Grapheme Clustering (mode 2027) #7799

aymanbagabas opened this issue Aug 28, 2024 · 1 comment

Comments

@aymanbagabas
Copy link

aymanbagabas commented Aug 28, 2024

Is your feature request related to a problem? Please describe.
Currently, Kitty always uses wcwidth to calculate the monospaced width of cell characters. The problem is that sometimes with certain characters, or what Unicode refer to as graphemes, such as emojis and multi-codepoint characters, wcwidth reports invalid width breaking the terminal display.

Describe the solution you'd like
DECRQM 2027 or mode 2027. When mode 2027 is enabled, Kitty should use Unicode grapheme clustering to calculate the cell character widths instead of wcwidth.

Additional context
A good write up explaining the issue in details and how mode 2027 proposes a reasonable solution https://mitchellh.com/writing/grapheme-clusters-in-terminals

Related: #3810

@kovidgoyal
Copy link
Owner

kitty doesn't use wcwidth. It uses the unicode standards to do grapheme
clustering but it doesn't support ZWJ see the open issue about it. It's
on my TODO list, but I probably wont support 2027 as I have something
better in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants