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

a box lines broken. #578

Closed
tinywolf3 opened this issue Nov 8, 2022 · 6 comments
Closed

a box lines broken. #578

tinywolf3 opened this issue Nov 8, 2022 · 6 comments
Labels

Comments

@tinywolf3
Copy link

tinywolf3 commented Nov 8, 2022

why is the box line character broken?

captures
image

@gdamore
Copy link
Owner

gdamore commented Nov 8, 2022

Looking at your output, it looks like you may be using an east asian locale. The spacing in the output seems to suggest it.

I think there are probably some bugs with placement, as we don't handle ambiguous width characters well in those circumstances. What you can try is running the same program in an "en" locale.

Now having said that, it looks like those box characters may be single wide ("narrow") characters, which means that they are going to be rendered with extra surrounding whitespace. This absolutely depends on the locale, and maybe also the font.

@gdamore
Copy link
Owner

gdamore commented Nov 8, 2022

I just tried running the demo with env LC_ALL=ja.UTF-8 and I see the same behavior. The boxes should not be so wide in an English locale.

@gdamore
Copy link
Owner

gdamore commented Nov 8, 2022

Screenshot 2022-11-08 at 7 36 15 AM

That's what it should look like.

@gdamore
Copy link
Owner

gdamore commented Nov 8, 2022

As a workaround, try setting RUNEWIDTH_EASTASIAN=0 in your environment. This makes the ambiguous characters be assumed to have a narrow width rather than a wide one. That fixed it for me.

I believe the real problem here is that if you are operating with a font that isn't aware of your locale, then you're going to wind up with some characters being treated as wide even though they actually aren't wide (or full width) in the font.

This seems to be a recurring problem and I'm not actually sure what to do about it.

@tinywolf3
Copy link
Author

thank you so much!
captures
image

@gdamore
Copy link
Owner

gdamore commented Nov 22, 2022

I'm starting to think that the default RUNEWIDTH value is wrong for most folks using terminal applications.

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

No branches or pull requests

2 participants