Skip to content

sliceToMaxWidth

sliceToMaxWidth(text, maxWidth): string

Defined in: packages/core/src/utils/displayWidth.ts:230

sliceToWidth measured by maxDisplayWidth — the head that fits the budget on any terminal, whatever it does with Ambiguous characters. The cut for a budget that must hold rather than merely look right.

string

number

string