alacritty / alacritty

A cross-platform, OpenGL terminal emulator.
https://alacritty.org
Apache License 2.0
55.98k stars 3.01k forks source link

doesn't render powerline symbols with ANSI terminals styles correctly #6436

Closed hronro closed 1 year ago

hronro commented 1 year ago

System

OS: macOS Version: alacritty 0.11.0

Step to reproduece

Run echo -e '\x1b[47m \x1b[49m\x1b[47m \x1b[49m'

Alacritty:

CleanShot 2022-10-22 at 19 12 57@2x

Kitty:

CleanShot 2022-10-22 at 19 13 01@2x
chrisduerr commented 1 year ago

It is rendered correctly, it just uses the font you specified instead of a custom font. There's some work in #5795 to include more symbols in our built-in font but powerline symbols are already pretty severe of a hack.

hronro commented 1 year ago

@chrisduerr I use the same font in Alacritty and Kitty but they look different. I also tried #5795 several days ago but it doesn't help.

hronro commented 1 year ago

Let me add some more details here.

It seems the characters and are rendered in different widths between Alacritty and Kitty:

CleanShot 2022-10-23 at 12 29 15@2x

(Alacritty on the top and Kitty on the bottom)

chrisduerr commented 1 year ago

That's because Kitty doesn't actually use your font to draw these characters. But Alacritty does.

hronro commented 1 year ago

@chrisduerr

It's pretty cool to know Kitty doesn't actually use my font to draw these characters.

I tried build Alacritty with PR #5795 , but it seems nothing improved. Does that means #5794 does not really solve the problem, or just because the PR is not complete yet?

kchibisov commented 1 year ago

That's because only default powerline characters are used there, not the ones you're using. By default powerline only had arrows.

hronro commented 1 year ago

@chrisduerr @kchibisov

One more question here. It seems Alacritty renders at double-width, which follows Unicode standards. However, when trying to render 12345, the number 1 is obscured by the character . Is this an expected behavior? Rendering other double-width characters like the Chinese characters won't have this kind of issue.

kchibisov commented 1 year ago

Probably the glyph in the font is just too big, since alacritty thinks that the size is 1, given that your text is drawn like that in the output of echo?