Vt constructor

Vt(
  1. int width,
  2. int height, {
  3. bool bce = true,
  4. bool konsoleLines = false,
  5. bool konsoleImages = false,
  6. TextSegmenter? segmenter,
  7. bool strict = true,
  8. bool allowLineFeed = false,
  9. bool scrollback = false,
  10. bool relativeOnly = false,
  11. int cellPixelWidth = 10,
  12. int cellPixelHeight = 20,
})

A width × height screen, blank, the cursor at its top left.

bce erases in the current background, as most terminals do; off, in the default one. konsoleLines keeps Konsole's line lengths, konsoleImages moves images as Konsole does. segmenter splits printed text into cells, by default as the application's TextSegmenter does. strict throws each error as it happens; off, they are only kept in errors. allowLineFeed takes LF, scrollback keeps the lines scrolled off the top in history, and relativeOnly makes an absolute row an error, as drawing on the alternate screen is (going there to ask queries is not): the three of an inline region's normal screen. cellPixelWidth and cellPixelHeight are the size of a cell in pixels, for images.

Implementation

Vt(
  this.width,
  this.height, {
  this.bce = true,
  this.konsoleLines = false,
  this.konsoleImages = false,
  TextSegmenter? segmenter,
  this.strict = true,
  this.allowLineFeed = false,
  this.scrollback = false,
  this.relativeOnly = false,
  this.cellPixelWidth = 10,
  this.cellPixelHeight = 20,
}) : segmenter = segmenter ?? TextSegmenter() {
  _grid = _newGrid(width, height);
  bottomMargin = height - 1;
  if (konsoleLines) {
    for (final row in _grid) {
      _lengths[row] = 0;
    }
  }
}