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

Emoji's don't affect the width in columns 🤔 #249

Open
benwinding opened this issue Aug 1, 2022 · 1 comment · May be fixed by #283
Open

Emoji's don't affect the width in columns 🤔 #249

benwinding opened this issue Aug 1, 2022 · 1 comment · May be fixed by #283

Comments

@benwinding
Copy link

See issue illustrated here

image

@Kenneth-Sills
Copy link

I think the arguably larger issue here would be how this affects CJK, which rely pretty heavily on fullwidth characters.

This is probably solved easily by pulling in a package like string-width and then replacing String(value).length with stringWidth(String(value)). Simple enough, I'll create a PR for that when I get a chance.

But a disclaimer that rendering text is really complicated and even terminals themselves get it wrong sometimes. Which is why things like Powerline 10k include steps to detect when ambiguous width characters are causing issues, so this probably won't be a universal fix. May be worth adding a 🤷 about that in the README once the fix is in to avoid false positives being reported again.

Kenneth-Sills added a commit to Kenneth-Sills/ink-table that referenced this issue Aug 6, 2024
This improves support for emojis and non-latin languages.

Closes maticzav#249
Kenneth-Sills added a commit to Kenneth-Sills/ink-table that referenced this issue Aug 6, 2024
This improves support for emojis and non-latin
languages. I've had to use an older version of
`string-width`, since anything more recent uses
ESM and we're not yet compatible with that (see

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

Successfully merging a pull request may close this issue.

2 participants