Skip to content

Segment

Defined in: src/render/segment.ts:130

A run of text sharing one Style — the unit drawn by ScreenBuffer.drawSegment.

new Segment(text, style?): Segment

Defined in: src/render/segment.ts:131

string

The run’s text.

Style = Style.DEFAULT

The run’s style.

Segment

readonly style: Style = Style.DEFAULT

Defined in: src/render/segment.ts:135

The run’s style.


readonly text: string

Defined in: src/render/segment.ts:133

The run’s text.

get cellLength(): number

Defined in: src/render/segment.ts:139

Display width of the text in cells (grapheme-aware).

number

crop(startCell, endCell): Segment

Defined in: src/render/segment.ts:144

Crop to the cell range [startCell, endCell), padding wide glyphs that straddle the edge with a space.

number

number

Segment