diff --git a/src/Screen.cpp b/src/Screen.cpp index 8ad4dee0..ffc3fd15 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -513,14 +513,18 @@ QVector Screen::getLineProperties(int startLine , int endLine) con return result; } -void Screen::reset(bool clearScreen) +void Screen::reset() { + // Clear screen, but preserve the current line + scrollUp(0, _cuY); + _cuY = 0; + + _currentModes[MODE_Origin] = false; + _savedModes[MODE_Origin] = false; + setMode(MODE_Wrap); saveMode(MODE_Wrap); // wrap at end of margin - resetMode(MODE_Origin); - saveMode(MODE_Origin); // position refer to [1,1] - resetMode(MODE_Insert); saveMode(MODE_Insert); // overstroke @@ -531,11 +535,11 @@ void Screen::reset(bool clearScreen) _topMargin = 0; _bottomMargin = _lines - 1; + // Other terminal emulators reset the entire scroll history during a reset +// setScroll(getScroll(), false); + setDefaultRendition(); saveCursor(); - - if (clearScreen) - clear(); } void Screen::clear() diff --git a/src/Screen.h b/src/Screen.h index a53aa452..f73add14 100644 --- a/src/Screen.h +++ b/src/Screen.h @@ -334,7 +334,7 @@ public: * If @p clearScreen is true then the screen contents are erased entirely, * otherwise they are unaltered. */ - void reset(bool clearScreen = true); + void reset(); /** * Displays a new character at the current cursor position.