Buffer class

Constructors

Buffer(TerminalState terminal, {required int maxLines, required bool isAltBuffer, Set<int>? wordSeparators})

Properties

absoluteCursorY int
Vertical position of the cursor relative to the top of the buffer, starting from 0.
no setter
absoluteMarginBottom int
Absolute index of the last line in the scroll region.
no setter
absoluteMarginTop int
Absolute index of the first line in the scroll region.
no setter
charset → Charset
final
currentLine BufferLine
The line at the current cursor position.
no setter
cursorX int
Horizontal position of the cursor relative to the top-left cornor of the screen, starting from 0.
no setter
cursorY int
Vertical position of the cursor relative to the top-left cornor of the screen, starting from 0.
no setter
hashCode int
The hash code for this object.
no setterinherited
height int
Total number of lines in the buffer. Always equal or greater than viewHeight.
no setter
isAltBuffer bool
final
isInVerticalMargin bool
no setter
lines → CircularList<BufferLine>
lines of the buffer. the length of lines should always be equal or greater than viewHeight.
latefinal
marginBottom int
Index of the last line in the scroll region.
no setter
marginTop int
Index of the first line in the scroll region.
no setter
maxLines int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollBack int
The number of lines above the viewport.
no setter
terminal TerminalState
final
viewHeight int
Height of the viewport in rows. Also the index of the last line.
no setter
viewWidth int
Width of the viewport in columns. Also the index of the last column.
no setter
wordSeparators Set<int>?
Characters that break selection when calling getWordBoundary. If null, defaults to defaultWordSeparators.
final

Methods

backspace() → void
clear() → void
Clears the viewport and scrollback buffer. Then fill with empty lines.
clearScrollback() → void
Remove all lines above the top of the viewport.
cursorGoForward() → void
deleteChars(int count) → void
deleteLines(int count) → void
Remove count lines starting at the current cursor position. Lines below the removed lines are shifted up. This only affects the scrollable region. Lines outside the scrollable region are not affected.
eraseChars(int count) → void
Erases count cells starting at the cursor position.
eraseDisplay() → void
Erases the whole viewport.
eraseDisplayFromCursor() → void
Erases the viewport from the cursor position to the end of the buffer, including the cursor position.
eraseDisplayToCursor() → void
Erases the viewport from the top-left corner to the cursor, including the cursor.
eraseLine() → void
Erases the line at the current cursor position.
eraseLineFromCursor() → void
Erases the line from the cursor to the end of the line, including the cursor position.
eraseLineToCursor() → void
Erases the line from the start of the line to the cursor, including the cursor.
getText([BufferRange? range]) String
Get the plain text content of the buffer including the scrollback. Accepts an optional range to get a specific part of the buffer.
getWordBoundary(CellOffset position) BufferRangeLine?
index() → void
https://vt100.net/docs/vt100-ug/chapter3.html#IND IND – Index
insertBlankChars(int count) → void
insertLines(int count) → void
lineFeed() → void
moveCursor(int offsetX, int offsetY) → void
moveCursorX(int offset) → void
moveCursorY(int offset) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetVerticalMargins() → void
resize(int oldWidth, int oldHeight, int newWidth, int newHeight) → void
restoreCursor() → void
Restore cursor position, charmap and text attributes.
reverseIndex() → void
https://terminalguide.namepad.de/seq/a_esc_cm/
saveCursor() → void
Save cursor position, charmap and text attributes.
scrollDown(int lines) → void
scrollUp(int lines) → void
setCursor(int cursorX, int cursorY) → void
setCursorX(int cursorX) → void
setCursorY(int cursorY) → void
setVerticalMargins(int top, int bottom) → void
Sets the vertical scrolling margin to top and bottom. Both values must be between 0 and viewHeight - 1.
toString() String
Returns a debug representation of the buffer.
override
write(String text) → void
Writes data to the _terminal. Terminal sequences or special characters are not interpreted and directly added to the buffer.
writeChar(int codePoint) → void
Writes a single character to the _terminal. Escape sequences or special characters are not interpreted and directly added to the buffer.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

defaultWordSeparators Set<int>
final