charmbracelet / bubbletea

A powerful little TUI framework 🏗
MIT License
27.48k stars 794 forks source link

Style distortion under Win11 termina #786

Closed debfig closed 1 year ago

debfig commented 1 year ago

Describe the bug Style distortion under Win11 termina

Screenshots

meowgorithm commented 1 year ago

Hi! This has to do with your locale (i.e. zh_CN.UTF-8). The easiest solve for this would be to set RUNEWIDTH_EASTASIAN=1 in your environment, however there are other thugs you can do as well. See: https://github.com/charmbracelet/lipgloss/issues/40 for details.

(Dup of https://github.com/charmbracelet/lipgloss/issues/40)

meowgorithm commented 1 year ago

Thinking about this some more. Even though this pertains to Lip Gloss, and is not really a bug, I wonder if it makes sense to set/restoreRUNEWIDTH_EASTASIAN on program start/shutdown to mintigate this issue. Not totally understanding the implications yet, think it’ll generally be harmless based on how runewidth is used with TUIs.

debfig commented 1 year ago

Thinking about this some more. Even though this pertains to Lip Gloss, and is not really a bug, I wonder if it makes sense to set/restore on program start/shutdown to mintigate this issue. Not totally understanding the implications yet, think it’ll generally be harmless based on how runewidth is used with TUIs.RUNEWIDTH_EASTASIAN

Thank you for your answer, which was very helpful to me. I am very sorry that I should not have thought this was a mistake