Pellipsis
Bun

property

SliceAnsiOptions.ellipsis

ellipsis?: string

If set, and content was cut at either edge of the requested range, insert this string at the cut edge(s). The ellipsis is counted against the visible-width budget and is emitted inside any active SGR styles (color, bold, etc.) so it inherits them, but outside any active OSC 8 hyperlink.

This turns sliceAnsi into a drop-in cli-truncate replacement:

  • truncate-end: sliceAnsi(str, 0, max, { ellipsis: "\u2026" })
  • truncate-start: sliceAnsi(str, -max, undefined, { ellipsis: "\u2026" })