Class: AnsiTermHistory

AnsiTermHistory(nLines, nColumns, historySize)

The AnsiTermHistory class is used to manage both the screen and the history of the terminal as a single array of lines. It keeps track of the visual lines and their attributes, and their relation to the logical lines. Visual lines are collected in reverse order, so that the last line in the screen (i.e., the bottom line) takes the index 0 in the array. Lines beyond the top of the screen contain the history of the terminal. To ease the access to the screen cells in the natural order (top to bottom), a pair of screen matrices is used, one for the primary screen and one for the alternate screen. The rows of the first matrix map the first "nLines" lines in the array from top (y=0) to bottom (y=nLines-1).

Constructor

new AnsiTermHistory(nLines, nColumns, historySize)

Parameters:
Name Type Description
nLines number

The number of lines in the terminal.

nColumns number

The number of columns in the terminal.

historySize number

The size of the history buffer.

Source:

Classes

AnsiTermHistory

Methods

_empty_lines() → {void}

Resets screen buffers to their initial state.

This method clears and reinitializes the primary and alternate screen buffers. It also resets the logical line tracking information and the logline_start pointer. History (i.e. the non-screen) part of the line collection is left unchanged.

Source:
Returns:
Type
void