Skip to content

Replace len([]rune) with lipgloss.Width for correct terminal column counting #102

@joshuacrass

Description

@joshuacrass

Problem:
In render.go, width is calculated using len([]rune(plain)):

pad := cols - len([]rune(plain)) - 4

len([]rune(s)) counts Unicode code points, not terminal display columns. CJK characters and certain emoji occupy 2 terminal columns each, so this calculation produces an incorrect result for any string containing wide characters, leading to misaligned or wrapped output.

Solution:
Replace len([]rune(s)) with lipgloss.Width(s) which uses a proper display-width algorithm consistent with the rest of the codebase.

Acceptance Criteria:

  • All width calculations in render.go use lipgloss.Width instead of len([]rune(…))
  • Status bar renders correctly for repo names or strings containing wide Unicode characters

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort:1Very small effort (< 1 hour)priority:lowLow priority - nice to havetype:bugBug fix

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions