Open
Description
Considering cli-truncate
works with terminal char widths, I think this expectation is valid:
expect(cliTruncate('πͺπΊ!', 2)).toEqual('β¦')
However due to country flags consisting of multiple code points treated as separate chars in slice-ansi
, cliTruncate returns "πͺβ¦"
This is not only rendering artifact but a broken invariant, e.g. string-width stringWidth("πͺβ¦")
returns 3 that is above requested width 2.
using Intl.Segmenter in slice-ansi
can be possible way to fix it: chalk/slice-ansi#35
Got here debugging ink truncation issue when line had country flag on box wrap edge)
Metadata
Metadata
Assignees
Labels
No labels