eraseDisplayToCursor method

void eraseDisplayToCursor({
  1. bool respectProtected = false,
})

Erases the viewport from the top-left corner to the cursor, including the cursor.

Implementation

void eraseDisplayToCursor({bool respectProtected = false}) {
  eraseLineToCursor(respectProtected: respectProtected);

  for (var i = 0; i < _cursorY; i++) {
    final line = lines[i + scrollBack];
    line.isWrapped = false;
    line.eraseRange(
      0,
      viewWidth,
      terminal.cursor,
      respectProtected: respectProtected,
    );
  }
}