Skip to content

Fix ambiguous-width character handling for CJK terminals #4199

Description

@sandip13579

Summary

get_character_cell_size() currently returns a width of 1 for East Asian Width (EAW) ambiguous characters.

Many CJK terminals render these characters using two cells, which can lead to incorrect text alignment.

This PR updates the fallback logic to return 2 for characters whose East Asian Width category is "A".

Testing

  • Verified that get_character_cell_size("…") previously returned 1.
  • Verified that it now returns 2.
  • Added/updated tests for the new behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions