38#include "TerminalCharacterDecoder.h"
39#include "konsole_wcwidth.h"
41using namespace Konsole;
45#define BS_CLEARS false
57#define loc(X, Y) ((Y)*columns + (X))
68 , screenLines(lines + 1)
71 , history(std::make_unique<HistoryScrollNone>())
80 , blockSelectionMode(false)
83 , effectiveRendition(0)
86 lineProperties.
resize(lines + 1);
87 for (
int i = 0; i < lines + 1; i++)
88 lineProperties[i] = LINE_DEFAULT;
107 int stop = cuY < _topMargin ? 0 : _topMargin;
108 cuX = qMin(columns - 1, cuX);
109 cuY = qMax(
stop, cuY - n);
117 int stop = cuY > _bottomMargin ? lines - 1 : _bottomMargin;
118 cuX = qMin(columns - 1, cuX);
119 cuY = qMin(
stop, cuY + n);
127 cuX = qMin(columns - 1, cuX);
128 cuX = qMax(0, cuX - n);
136 cuX = qMin(columns - 1, cuX + n);
148 if (!(0 <= top && top < bot && bot < lines)) {
154 cuY =
getMode(MODE_Origin) ? top : 0;
163 return _bottomMargin;
169 if (cuY == _bottomMargin)
171 else if (cuY < lines - 1)
178 if (cuY == _topMargin)
195 int p = qMax(0, qMin(cuX + n - 1, columns - 1));
196 clearImage(loc(cuX, cuY), loc(p, cuY),
' ');
208 if (cuX >= screenLines[cuY].size())
211 if (cuX + n > screenLines[cuY].size())
212 n = screenLines[cuY].size() - cuX;
215 Q_ASSERT(cuX + n <= screenLines[cuY].size());
217 screenLines[cuY].remove(cuX, n);
225 if (screenLines[cuY].size() < cuX)
226 screenLines[cuY].resize(cuX);
228 screenLines[cuY].insert(cuX, n,
' ');
230 if (screenLines[cuY].size() > columns)
231 screenLines[cuY].resize(columns);
249 for (
int i = 0; i < count; i++) {
270 currentModes[m] =
true;
281 currentModes[m] =
false;
292 savedModes[m] = currentModes[m];
297 currentModes[m] = savedModes[m];
302 return currentModes[m];
307 savedState.cursorColumn = cuX;
308 savedState.cursorLine = cuY;
309 savedState.rendition = currentRendition;
310 savedState.foreground = currentForeground;
311 savedState.background = currentBackground;
316 cuX = qMin(savedState.cursorColumn, columns - 1);
317 cuY = qMin(savedState.cursorLine, lines - 1);
318 currentRendition = savedState.rendition;
319 currentForeground = savedState.foreground;
320 currentBackground = savedState.background;
321 updateEffectiveRendition();
326 if ((new_lines == lines) && (new_columns == columns))
329 if (cuY > new_lines - 1) {
330 _bottomMargin = lines - 1;
331 for (
int i = 0; i < cuY - (new_lines - 1); i++) {
340 for (
int i = 0; i < qMin(lines, new_lines + 1); i++)
341 newScreenLines[i] = screenLines[i];
342 for (
int i = lines; (i > 0) && (i < new_lines + 1); i++)
343 newScreenLines[i].resize(new_columns);
345 lineProperties.
resize(new_lines + 1);
346 for (
int i = lines; (i > 0) && (i < new_lines + 1); i++)
347 lineProperties[i] = LINE_DEFAULT;
352 screenLines = std::move(newScreenLines);
355 columns = new_columns;
356 cuX = qMin(cuX, columns - 1);
357 cuY = qMin(cuY, lines - 1);
361 _bottomMargin = lines - 1;
369 _bottomMargin = lines - 1;
406void Screen::reverseRendition(
Character &p)
const
415void Screen::updateEffectiveRendition()
417 effectiveRendition = currentRendition;
418 if (currentRendition & RE_REVERSE) {
419 effectiveForeground = currentBackground;
420 effectiveBackground = currentForeground;
422 effectiveForeground = currentForeground;
423 effectiveBackground = currentBackground;
426 if (currentRendition & RE_BOLD)
430void Screen::copyFromHistory(std::span<Character> dest,
int startLine,
int count)
const
432 Q_ASSERT(startLine >= 0 && count > 0 && startLine + count <= history->
getLines());
434 for (
int line = startLine; line < startLine + count; line++) {
435 const int length = qMin(columns, history->getLineLen(line));
436 const int destLineOffset = (line - startLine) * columns;
438 history->getCells(line, 0, length, dest.subspan(destLineOffset));
440 for (
int column = length; column < columns; column++)
441 dest[destLineOffset + column] = defaultChar;
444 if (selBegin != -1) {
445 for (
int column = 0; column < columns; column++) {
447 reverseRendition(dest[destLineOffset + column]);
454void Screen::copyFromScreen(std::span<Character> dest,
int startLine,
int count)
const
456 Q_ASSERT(startLine >= 0 && count > 0 && startLine + count <= lines);
458 for (
int line = startLine; line < (startLine + count); line++) {
459 int srcLineStartIndex = line * columns;
460 int destLineStartIndex = (line - startLine) * columns;
462 for (
int column = 0; column < columns; column++) {
463 int srcIndex = srcLineStartIndex + column;
464 int destIndex = destLineStartIndex + column;
466 dest[destIndex] = screenLines[srcIndex / columns].value(srcIndex % columns, defaultChar);
469 if (selBegin != -1 &&
isSelected(column, line + history->getLines()))
470 reverseRendition(dest[destIndex]);
475void Screen::getImage(std::span<Character> dest,
int size,
int startLine,
int endLine)
const
477 Q_ASSERT(startLine >= 0);
478 Q_ASSERT(endLine >= startLine && endLine < history->
getLines() + lines);
480 const int mergedLines = endLine - startLine + 1;
482 Q_ASSERT(size >= mergedLines * columns);
485 const int linesInHistoryBuffer = qBound(0, history->getLines() - startLine, mergedLines);
486 const int linesInScreenBuffer = mergedLines - linesInHistoryBuffer;
489 if (linesInHistoryBuffer > 0)
490 copyFromHistory(dest, startLine, linesInHistoryBuffer);
493 if (linesInScreenBuffer > 0)
494 copyFromScreen(dest.subspan(linesInHistoryBuffer * columns), startLine + linesInHistoryBuffer - history->getLines(), linesInScreenBuffer);
498 for (
int i = 0; i < mergedLines * columns; i++)
499 reverseRendition(dest[i]);
503 int cursorIndex = loc(cuX, cuY + linesInHistoryBuffer);
504 if (
getMode(MODE_Cursor) && cursorIndex < columns * mergedLines)
505 dest[cursorIndex].rendition |= RE_CURSOR;
510 Q_ASSERT(startLine >= 0);
511 Q_ASSERT(endLine >= startLine && endLine < history->
getLines() + lines);
513 const int mergedLines = endLine - startLine + 1;
514 const int linesInHistory = qBound(0, history->getLines() - startLine, mergedLines);
515 const int linesInScreen = mergedLines - linesInHistory;
521 for (
int line = startLine; line < startLine + linesInHistory; line++) {
523 if (history->isWrappedLine(line)) {
524 result[
index] = (LineProperty)(result[
index] | LINE_WRAPPED);
530 const int firstScreenLine = startLine + linesInHistory - history->getLines();
531 for (
int line = firstScreenLine; line < firstScreenLine + linesInScreen; line++) {
532 result[
index] = lineProperties[line];
552 _bottomMargin = lines - 1;
569 cuX = qMin(columns - 1, cuX);
570 cuX = qMax(0, cuX - 1);
572 if (screenLines[cuY].size() < cuX + 1)
573 screenLines[cuY].resize(cuX + 1);
576 screenLines[cuY][cuX].character = u
' ';
584 while ((n > 0) && (cuX < columns - 1)) {
586 while ((cuX < columns - 1) && !tabStops[cuX])
597 while ((n > 0) && (cuX > 0)) {
599 while ((cuX > 0) && !tabStops[cuX])
607 for (
int i = 0; i < columns; i++)
618void Screen::initTabStops()
625 for (
int i = 0; i < columns; i++)
626 tabStops[i] = (i % 8 == 0 && i != 0);
640 int scr_TL = loc(0, history->getLines());
642 if ((selBottomRight >= (from + scr_TL)) && (selTopLeft <= (to + scr_TL)))
653 int w = konsole_wcwidth(c);
657 if (cuX + w > columns) {
659 lineProperties[cuY] = (LineProperty)(lineProperties[cuY] | LINE_WRAPPED);
666 int size = screenLines[cuY].size();
667 if (size < cuX + w) {
668 screenLines[cuY].resize(cuX + w);
674 lastPos = loc(cuX, cuY);
679 Character ¤tChar = screenLines[cuY][cuX];
684 currentChar.
rendition = effectiveRendition;
689 int newCursorX = cuX + w--;
693 if (screenLines[cuY].size() < cuX + i + 1)
694 screenLines[cuY].resize(cuX + i + 1);
696 Character &ch = screenLines[cuY][cuX + i];
707void Screen::compose(
const QString & )
722 return _scrolledLines;
726 return _droppedLines;
748 return _lastScrolledRegion;
755 if (from > _bottomMargin)
757 if (from + n > _bottomMargin)
758 n = _bottomMargin + 1 - from;
761 _lastScrolledRegion =
QRect(0, _topMargin, columns - 1, (_bottomMargin - _topMargin));
764 moveImage(loc(0, from), loc(0, from + n), loc(columns, _bottomMargin));
765 clearImage(loc(0, _bottomMargin - n + 1), loc(columns - 1, _bottomMargin),
' ');
782 if (from > _bottomMargin)
784 if (from + n > _bottomMargin)
785 n = _bottomMargin - from;
786 moveImage(loc(0, from + n), loc(0, from), loc(columns - 1, _bottomMargin - n));
787 clearImage(loc(0, from), loc(columns - 1, from + n - 1),
' ');
801 cuX = qMax(0, qMin(columns - 1, x));
809 cuY = qMax(0, qMin(lines - 1, y + (
getMode(MODE_Origin) ? _topMargin : 0)));
833void Screen::clearImage(
int loca,
int loce,
char c)
835 int scr_TL = loc(0, history->getLines());
839 if ((selBottomRight > (loca + scr_TL)) && (selTopLeft < (loce + scr_TL))) {
843 int topLine = loca / columns;
844 int bottomLine = loce / columns;
846 Character clearCh(c, currentForeground, currentBackground, DEFAULT_RENDITION);
850 bool isDefaultCh = (clearCh ==
Character());
852 for (
int y = topLine; y <= bottomLine; y++) {
853 lineProperties[y] = 0;
855 int endCol = (y == bottomLine) ? loce % columns : columns - 1;
856 int startCol = (y == topLine) ? loca % columns : 0;
860 if (isDefaultCh && endCol == columns - 1) {
863 if (line.
size() < endCol + 1)
867 for (
int i = startCol; i <= endCol; i++)
873void Screen::moveImage(
int dest,
int sourceBegin,
int sourceEnd)
875 Q_ASSERT(sourceBegin <= sourceEnd);
877 int lines = (sourceEnd - sourceBegin) / columns;
884 if (dest < sourceBegin) {
885 for (
int i = 0; i <= lines; i++) {
886 screenLines[(dest / columns) + i] = screenLines[(sourceBegin / columns) + i];
887 lineProperties[(dest / columns) + i] = lineProperties[(sourceBegin / columns) + i];
890 for (
int i = lines; i >= 0; i--) {
891 screenLines[(dest / columns) + i] = screenLines[(sourceBegin / columns) + i];
892 lineProperties[(dest / columns) + i] = lineProperties[(sourceBegin / columns) + i];
897 int diff = dest - sourceBegin;
899 if ((lastPos < 0) || (lastPos >= (lines * columns)))
904 if (selBegin != -1) {
905 bool beginIsTL = (selBegin == selTopLeft);
906 int diff = dest - sourceBegin;
907 int scr_TL = loc(0, history->getLines());
908 int srca = sourceBegin + scr_TL;
909 int srce = sourceEnd + scr_TL;
910 int desta = srca + diff;
911 int deste = srce + diff;
913 if ((selTopLeft >= srca) && (selTopLeft <= srce))
915 else if ((selTopLeft >= desta) && (selTopLeft <= deste))
918 if ((selBottomRight >= srca) && (selBottomRight <= srce))
919 selBottomRight += diff;
920 else if ((selBottomRight >= desta) && (selBottomRight <= deste))
923 if (selBottomRight < 0) {
931 selBegin = selTopLeft;
933 selBegin = selBottomRight;
939 clearImage(loc(cuX, cuY), loc(columns - 1, lines - 1),
' ');
944 clearImage(loc(0, 0), loc(cuX, cuY),
' ');
950 for (
int i = 0; i < (lines - 1); i++) {
955 clearImage(loc(0, 0), loc(columns - 1, lines - 1),
' ');
964 clearImage(loc(0, 0), loc(columns - 1, lines - 1),
'E');
969 clearImage(loc(cuX, cuY), loc(columns - 1, cuY),
' ');
974 clearImage(loc(0, cuY), loc(cuX, cuY),
' ');
979 clearImage(loc(0, cuY), loc(columns - 1, cuY),
' ');
984 currentRendition |= re;
985 updateEffectiveRendition();
990 currentRendition &= ~re;
991 updateEffectiveRendition();
998 currentRendition = DEFAULT_RENDITION;
999 updateEffectiveRendition();
1006 if (currentForeground.
isValid())
1007 updateEffectiveRendition();
1016 if (currentBackground.
isValid())
1017 updateEffectiveRendition();
1024 selBottomRight = -1;
1031 if (selTopLeft != -1) {
1032 column = selTopLeft % columns;
1033 line = selTopLeft / columns;
1041 if (selBottomRight != -1) {
1042 column = selBottomRight % columns;
1043 line = selBottomRight / columns;
1051 selBegin = loc(x, y);
1056 selBottomRight = selBegin;
1057 selTopLeft = selBegin;
1058 blockSelectionMode = mode;
1066 int endPos = loc(x, y);
1068 if (endPos < selBegin) {
1069 selTopLeft = endPos;
1070 selBottomRight = selBegin;
1076 selTopLeft = selBegin;
1077 selBottomRight = endPos;
1081 if (blockSelectionMode) {
1082 int topRow = selTopLeft / columns;
1083 int topColumn = selTopLeft % columns;
1084 int bottomRow = selBottomRight / columns;
1085 int bottomColumn = selBottomRight % columns;
1087 selTopLeft = loc(qMin(topColumn, bottomColumn), topRow);
1088 selBottomRight = loc(qMax(topColumn, bottomColumn), bottomRow);
1094 bool columnInSelection =
true;
1095 if (blockSelectionMode) {
1096 columnInSelection = x >= (selTopLeft % columns) && x <= (selBottomRight % columns);
1099 int pos = loc(x, y);
1100 return pos >= selTopLeft && pos <= selBottomRight && columnInSelection;
1109 decoder.
begin(&stream);
1116bool Screen::isSelectionValid()
const
1118 return selTopLeft >= 0 && selBottomRight >= 0;
1123 if (!isSelectionValid())
1125 writeToStream(decoder, selTopLeft, selBottomRight, preserveLineBreaks);
1128void Screen::writeToStream(
TerminalCharacterDecoder *decoder,
int startIndex,
int endIndex,
bool preserveLineBreaks)
const
1130 int top = startIndex / columns;
1131 int left = startIndex % columns;
1133 int bottom = endIndex / columns;
1134 int right = endIndex % columns;
1136 Q_ASSERT(top >= 0 && left >= 0 && bottom >= 0 && right >= 0);
1138 for (
int y = top; y <= bottom; y++) {
1140 if (y == top || blockSelectionMode)
1144 if (y == bottom || blockSelectionMode)
1145 count = right -
start + 1;
1147 const bool appendNewLine = (y != bottom);
1148 int copied = copyLineToStream(y,
start, count, decoder, appendNewLine, preserveLineBreaks);
1155 if (y == bottom && copied < count) {
1157 decoder->
decodeLine(std::span(&newLineChar, 1), 0);
1162int Screen::copyLineToStream(
int line,
int start,
int count,
TerminalCharacterDecoder *decoder,
bool appendNewLine,
bool preserveLineBreaks)
const
1168 static const int MAX_CHARS = 1024;
1169 static std::array<Character, MAX_CHARS> characterBuffer;
1171 Q_ASSERT(count < MAX_CHARS);
1173 LineProperty currentLineProperties = 0;
1177 const int lineLength = history->getLineLen(line);
1180 start = qMin(
start, qMax(0, lineLength - 1));
1186 count = lineLength -
start;
1188 count = qMin(
start + count, lineLength) -
start;
1192 Q_ASSERT(
start >= 0);
1193 Q_ASSERT(count >= 0);
1194 Q_ASSERT((
start + count) <= history->getLineLen(line));
1196 history->getCells(line,
start, count, characterBuffer);
1198 if (history->isWrappedLine(line))
1199 currentLineProperties |= LINE_WRAPPED;
1202 count = columns -
start;
1204 Q_ASSERT(count >= 0);
1206 const int screenLine = line - history->getLines();
1208 auto data = screenLines[screenLine].data();
1209 int length = screenLines[screenLine].size();
1212 for (
int i =
start; i < qMin(
start + count, length); i++) {
1213 characterBuffer[i -
start] = data[i];
1217 count = qBound(0, length -
start, count);
1219 Q_ASSERT(screenLine < lineProperties.
size());
1220 currentLineProperties |= lineProperties[screenLine];
1224 const bool omitLineBreak = (currentLineProperties & LINE_WRAPPED) || !preserveLineBreaks;
1226 if (!omitLineBreak && appendNewLine && (count + 1 < MAX_CHARS)) {
1227 characterBuffer[count] =
'\n';
1232 decoder->
decodeLine(std::span(characterBuffer).subspan(0, count), currentLineProperties);
1239 writeToStream(decoder, loc(0, fromLine), loc(columns - 1, toLine));
1242void Screen::addHistLine()
1248 int oldHistLines = history->getLines();
1250 history->addCellsVector(screenLines[0]);
1251 history->addLine(lineProperties[0] & LINE_WRAPPED);
1253 int newHistLines = history->getLines();
1255 bool beginIsTL = (selBegin == selTopLeft);
1259 if (newHistLines == oldHistLines)
1263 if (newHistLines > oldHistLines) {
1264 if (selBegin != -1) {
1265 selTopLeft += columns;
1266 selBottomRight += columns;
1270 if (selBegin != -1) {
1272 int top_BR = loc(0, 1 + newHistLines);
1274 if (selTopLeft < top_BR)
1275 selTopLeft -= columns;
1277 if (selBottomRight < top_BR)
1278 selBottomRight -= columns;
1280 if (selBottomRight < 0)
1288 selBegin = selTopLeft;
1290 selBegin = selBottomRight;
1297 return history->getLines();
1304 if (copyPreviousScroll)
1305 history = t.scroll(std::move(history));
1307 auto oldScroll = std::move(history);
1308 history = t.scroll(
nullptr);
1314 return history->hasScroll();
1319 return history->getType();
1325 lineProperties[cuY] = (LineProperty)(lineProperties[cuY] | property);
1327 lineProperties[cuY] = (LineProperty)(lineProperties[cuY] & ~property);
1331 for (
int i = 0; i < count; i++)
1332 dest[i] = defaultChar;
Describes the color of a single character in the terminal.
void setIntensive()
Set the value of this color from a normal system color to the corresponding intensive system color if...
constexpr bool isValid() const
Returns true if this character color entry is valid.
A single character in the terminal which consists of a unicode character value, foreground and backgr...
QChar character
The unicode character value for this character.
CharacterColor foregroundColor
The foreground color used to draw this character.
CharacterColor backgroundColor
The color used to draw this character's background.
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character.
A terminal character decoder which produces plain text, ignoring colours and other appearance-related...
void end() override
End decoding.
void begin(QTextStream *output) override
Begin decoding characters.
void setCursorYX(int y, int x)
Position the cursor at line y, column x.
void saveMode(int mode)
Saves the state of the specified screen mode.
int getCursorY() const
Returns the line which the cursor is positioned on.
void clearToEndOfScreen()
Clear the area of the screen from the current cursor position to the end of the screen.
void resizeImage(int new_lines, int new_columns)
Resizes the image to a new fixed size of new_lines by new_columns.
void deleteChars(int n)
Delete n characters beginning from the current cursor position.
void setMargins(int topLine, int bottomLine)
Sets the margins for scrolling the screen.
void checkSelection(int from, int to)
Checks if the text between from and to is inside the current selection.
void setScroll(const HistoryType &, bool copyPreviousScroll=true)
Sets the type of storage used to keep lines in the history.
void reset(bool clearScreen=true)
Resets the state of the screen.
void clearEntireScreen()
Clear the whole screen, moving the current screen contents into the history first.
void getImage(std::span< Character > dest, int size, int startLine, int endLine) const
Returns the current screen image.
void saveCursor()
Saves the current position and appearance (text color and style) of the cursor.
void clearToBeginOfLine()
Clears from the current cursor position to the beginning of the line.
void clearEntireLine()
Clears the whole of the line on which the cursor is currently positioned.
void clear()
Clear the entire screen and move the cursor to the home position.
void setCursorY(int y)
Position the cursor on line y.
const HistoryType & getScroll() const
Returns the type of storage used to keep lines in the history.
void insertChars(int n)
Insert n blank characters beginning from the current cursor position.
Screen(int lines, int columns)
Construct a new screen image of size lines by columns.
void writeSelectionToStream(TerminalCharacterDecoder *decoder, bool preserveLineBreaks=true) const
Copies the selected characters, set using.
void tab(int n=1)
Moves the cursor n tab-stops to the right.
void changeTabStop(bool set)
Sets or removes a tab stop at the cursor's current column.
void cursorDown(int n)
Move the cursor down by n lines.
void setDefaultMargins()
Resets the scrolling margins back to the top and bottom lines of the screen.
void home()
Sets the position of the cursor to the 'home' position at the top-left corner of the screen (0,...
void backtab(int n)
Moves the cursor n tab-stops to the left.
void setCursorX(int x)
Position the cursor at column x.
void setSelectionEnd(const int column, const int line)
Sets the end of the current selection.
void displayCharacter(QChar c)
Displays a new character at the current cursor position.
void clearTabStops()
Clears all the tab stops.
void clearToBeginOfScreen()
Clear the area of the screen from the current cursor position to the start of the screen.
void eraseChars(int n)
Erase n characters beginning from the current cursor position.
static void fillWithDefaultChar(std::span< Character > dest, int count)
Fills the buffer dest with count instances of the default (ie.
void writeLinesToStream(TerminalCharacterDecoder *decoder, int fromLine, int toLine) const
Copies part of the output to a stream.
void repeatChars(int count)
Repeat the preceeding graphic character @count times, including SPACE.
void getSelectionStart(int &column, int &line) const
Retrieves the start of the selection or the cursor position if there is no selection.
int getHistLines() const
Return the number of lines in the history buffer.
void helpAlign()
Fills the entire screen with the letter 'E'.
void getSelectionEnd(int &column, int &line) const
Retrieves the end of the selection or the cursor position if there is no selection.
int getCursorX() const
Returns the column which the cursor is positioned at.
QRect lastScrolledRegion() const
Returns the region of the image which was last scrolled.
void cursorUp(int n)
Move the cursor up by n lines.
int topMargin() const
Returns the top line of the scrolling region.
int getLines() const
Return the number of lines.
int scrolledLines() const
Returns the number of lines that the image has been scrolled up or down by, since the last call to re...
void clearSelection()
Clears the current selection.
void setSelectionStart(const int column, const int line, const bool blockSelectionMode)
Sets the start of the selection.
bool getMode(int mode) const
Returns whether the specified screen mode is enabled or not .
void setLineProperty(LineProperty property, bool enable)
Sets or clears an attribute of the current line.
void setMode(int mode)
Sets (enables) the specified screen mode.
bool isSelected(const int column, const int line) const
Returns true if the character at (column, line) is part of the current selection.
void setDefaultRendition()
Resets the cursor's color back to the default and sets the character's rendition flags back to the de...
void resetScrolledLines()
Resets the count of the number of lines that the image has been scrolled up or down by,...
void backspace()
Moves the cursor one column to the left and erases the character at the new cursor position.
void scrollDown(int n)
Scroll the scrolling region of the screen down by n lines.
void scrollUp(int n)
Scroll the scrolling region of the screen up by n lines.
void cursorRight(int n)
Move the cursor to the right by n columns.
void restoreMode(int mode)
Restores the state of a screen mode saved by calling saveMode()
int bottomMargin() const
Returns the bottom line of the scrolling region.
QVector< LineProperty > getLineProperties(int startLine, int endLine) const
Returns the additional attributes associated with lines in the image.
void resetRendition(int rendition)
Disables the given rendition flag.
void toStartOfLine()
Moves the cursor to the beginning of the current line.
void resetDroppedLines()
Resets the count of the number of lines dropped from the history.
void newLine()
Moves the cursor down one line, if the MODE_NewLine mode flag is enabled then the cursor is returned ...
void restoreCursor()
Restores the position and appearance of the cursor.
void setRendition(int rendition)
Enables the given rendition flag.
void setBackColor(int space, int color)
Sets the cursor's background color.
int droppedLines() const
Returns the number of lines of output which have been dropped from the history since the last call to...
void deleteLines(int n)
Removes n lines beginning from the current cursor position.
void resetMode(int mode)
Resets (clears) the specified screen mode.
QString selectedText(bool preserveLineBreaks) const
Convenience method.
void index()
Move the cursor down one line.
void nextLine()
Moves the cursor down one line and positions it at the beginning of the line.
void reverseIndex()
Move the cursor up one line.
void clearToEndOfLine()
Clears from the current cursor position to the end of the line.
void cursorLeft(int n)
Move the cursor to the left by n columns.
bool hasScroll() const
Returns true if this screen keeps lines that are scrolled off the screen in a history buffer.
void setForeColor(int space, int color)
Sets the cursor's foreground color.
void insertLines(int n)
Inserts lines beginning from the current cursor position.
Base class for terminal character decoders.
virtual void decodeLine(std::span< const Character > characters, LineProperty properties)=0
Converts a line of terminal characters with associated properties into a text string and writes the s...
void stop(Ekos::AlignState mode)
Q_SCRIPTABLE Q_NOREPLY void start()
void resize(qsizetype size)
void resize(qsizetype size)
qsizetype size() const const
void resize(qsizetype size)
qsizetype size() const const