pterm / pterm

✨ #PTerm is a modern Go module to easily beautify console output. Featuring charts, progressbars, tables, trees, text input, select menus and much more 🚀 It's completely configurable and 100% cross-platform compatible.

Home Page:https://pterm.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong print of box with title including asian characters

FLAGLORD opened this issue · comments

If the title of box includes asian characters, it would not print in a pretty way.

┌─ 测试 ─┐
|          |
└──────────┘

if (maxWidth + p.RightPadding + p.LeftPadding - 4) < len(RemoveColorFromString(p.Title)) {

Len() is not suitable for asian characters. Maybe runewidth.StringWidth() is a better choice.

Thanks for reporting the issue! Will be fixed in the next release.