-
Notifications
You must be signed in to change notification settings - Fork 475
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
Incorrect table alignment under some terminal emulators due to double-width characters #111
Comments
@schachmat thanks for the fast response. That doesn't look fixed to me, though; see screenshot below. Am I missing something? |
Heyho @ronjouch, The issue seems to be that alacritty does not support east asian ambiguous characters yet. In your screenshot the icons seem to occupy 2 cells, so I assume alacritty currently always renders as in an east-asian locale. The following dirty workaround might provide a correct rendering until the alacritty issue is resolved:
If you installed the locale as above you can test with |
@schachmat only one of the glyphs you linked to is ambiguous width. These classifications changed in Unicode 9.0, and it might be that wego and Alacritty are using different definitions.
Quite the opposite, actually. We don't correctly handle ambiguous width characters for those locales, but they should be fine for everyone else. |
I'm a bit lost among the terminalese, but in case that helps/confirms what you are discussing, @schachmat @jwilm, the |
Thanks for the update. The issue in the workaround screenshot is probably related to the dash between the min and max temperatures. Maybe the width property of that rune changed as well or the original author of the frontend did not notice the issue in the first place. I'll investigate. |
Unfortunately, go-runewidth had switch to Unicode 9.0 . I'm sorry if you get wrong. |
I am totally for using the latest unicode standard! My problem is that still I don't quite understand where the issue comes from exactly. To provide a correct table layout, Now the issue could be located in either of our three projects. I'll check my code again and also try to verify that |
Thanks for the detailed follow up @schachmat.
That makes (at least) two of us! I've spent some more time investigating on my side this morning, and there's a chance this is due to Alacritty not handling the variation selector on some of those glyphs (perhaps rendering them as an extra space). I don't know conclusively yet, but I'll follow up as time permits. |
I just noticed that rendering appears to be broken in gnome-terminal in the latest version. The same version in Alacritty has the opposite spacing problem: Thinking about it a bit more, command-line applications are always going to have the problem that some terminals use older Unicode definitions, and others newer. The only way to handle both properly is to avoid reliance on the terminal spacing for wide characters. This could be done via goto column commands. The escape sequence is Naturally there's still an issue with Alacritty and the variation selector handling. |
Heyho @jwilm, Thanks for your thoughts on the issue and the quick fix of the variation selector code! To be honest I don't even know, why the author of this frontend used a variation selector for the I'll think about using the goto column escape code, but intuitively I don't think it's the best solution:
I'll leave this issue open until I have a final decision. Thank you all for participating! |
@jwilm just to be sure: I don't see it fixed here (fresh Alacritty + wego HEAD builds), I guess your fix is still in an unmerged branch? |
@ronjouch Yeah, still on my machine. I'll push up a branch, but it's not ready to merge into master. Let's continue this discussion on the Alacritty tracker or IRC. |
So I assume there is nothing left to do here and will close the issue now. If you find further issues feel free to reopen or create a new issue. |
This is a followup to discussion on Alacritty commit 3ad68699 (Alacritty is a "cross-platform, GPU-accelerated terminal emulator").
The problem is that, in some terminals, wego 2.0 table alignment suffers from the width of the unicode characters used (cloud, sun, etc). See for yourself:
To me that looked like a bug in Alacritty, but its main developer, @jwilm, comments that:
The text was updated successfully, but these errors were encountered: