Interface: IBufferCell

Represents a single cell in the terminal’s buffer.

Hierarchy

  • IBufferCell

Index

Methods

Methods

getBgColor

getBgColor(): number

Defined in xterm.d.ts:1424

Gets a cell’s background color number, this differs depending on what the color mode of the cell is:

  • Default: This should be 0, representing the default background color (CSI 49 m).
  • Palette: This is a number from 0 to 255 of ANSI colors (CSI 4(0-7) m, CSI 10(0-7) m, CSI 48 ; 5 ; 0-255 m).
  • RGB: A hex value representing a ‘true color’: 0xRRGGBB (CSI 4 8 ; 2 ; Pi ; Pr ; Pg ; Pb)

Returns: number


getBgColorMode

getBgColorMode(): number

Defined in xterm.d.ts:1398

Gets the number representation of the background color mode, this can be used to perform quick comparisons of 2 cells to see if they’re the same. Use isBgRGB, isBgPalette and isBgDefault to check what color mode a cell is.

Returns: number


getChars

getChars(): string

Defined in xterm.d.ts:1376

The character(s) within the cell. Examples of what this can contain:

  • A normal width character
  • A wide character (eg. CJK)
  • An emoji

Returns: string


getCode

getCode(): number

Defined in xterm.d.ts:1382

Gets the UTF32 codepoint of single characters, if content is a combined string it returns the codepoint of the last character in the string.

Returns: number


getFgColor

getFgColor(): number

Defined in xterm.d.ts:1411

Gets a cell’s foreground color number, this differs depending on what the color mode of the cell is:

  • Default: This should be 0, representing the default foreground color (CSI 39 m).
  • Palette: This is a number from 0 to 255 of ANSI colors (CSI 3(0-7) m, CSI 9(0-7) m, CSI 38 ; 5 ; 0-255 m).
  • RGB: A hex value representing a ‘true color’: 0xRRGGBB. (CSI 3 8 ; 2 ; Pi ; Pr ; Pg ; Pb)

Returns: number


getFgColorMode

getFgColorMode(): number

Defined in xterm.d.ts:1390

Gets the number representation of the foreground color mode, this can be used to perform quick comparisons of 2 cells to see if they’re the same. Use isFgRGB, isFgPalette and isFgDefault to check what color mode a cell is.

Returns: number


getWidth

getWidth(): number

Defined in xterm.d.ts:1367

The width of the character. Some examples:

  • 1 for most cells.
  • 2 for wide character like CJK glyphs.
  • 0 for cells immediately following cells with a width of 2.

Returns: number


isAttributeDefault

isAttributeDefault(): boolean

Defined in xterm.d.ts:1455

Whether the cell has the default attribute (no color or style).

Returns: boolean


isBgDefault

isBgDefault(): boolean

Defined in xterm.d.ts:1452

Whether the cell is using the default background color mode.

Returns: boolean


isBgPalette

isBgPalette(): boolean

Defined in xterm.d.ts:1448

Whether the cell is using the palette background color mode.

Returns: boolean


isBgRGB

isBgRGB(): boolean

Defined in xterm.d.ts:1444

Whether the cell is using the RGB background color mode.

Returns: boolean


isBlink(): number

Defined in xterm.d.ts:1435

Whether the cell has the inverse attribute (CSI 5 m).

Returns: number


isBold

isBold(): number

Defined in xterm.d.ts:1427

Whether the cell has the bold attribute (CSI 1 m).

Returns: number


isDim

isDim(): number

Defined in xterm.d.ts:1431

Whether the cell has the inverse attribute (CSI 2 m).

Returns: number


isFgDefault

isFgDefault(): boolean

Defined in xterm.d.ts:1450

Whether the cell is using the default foreground color mode.

Returns: boolean


isFgPalette

isFgPalette(): boolean

Defined in xterm.d.ts:1446

Whether the cell is using the palette foreground color mode.

Returns: boolean


isFgRGB

isFgRGB(): boolean

Defined in xterm.d.ts:1442

Whether the cell is using the RGB foreground color mode.

Returns: boolean


isInverse

isInverse(): number

Defined in xterm.d.ts:1437

Whether the cell has the inverse attribute (CSI 7 m).

Returns: number


isInvisible

isInvisible(): number

Defined in xterm.d.ts:1439

Whether the cell has the inverse attribute (CSI 8 m).

Returns: number


isItalic

isItalic(): number

Defined in xterm.d.ts:1429

Whether the cell has the inverse attribute (CSI 3 m).

Returns: number


isUnderline

isUnderline(): number

Defined in xterm.d.ts:1433

Whether the cell has the underline attribute (CSI 4 m).

Returns: number