Commit 4e0bcd4e authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Set default rendition before clearing the screen

Otherwise, weirdness ensues.  e.g. if you do:

seq 1 $((LINES)); printf '\e[31m\ec'

and try to select the blank lines, the selection shows the previous
rendition color.
parent 694d1c68
......@@ -782,9 +782,11 @@ int Screen::getScreenLineColumns(const int line) const
void Screen::reset(bool softReset, bool preservePrompt)
{
// Clear screen, but preserve the current line
setDefaultRendition();
if (!softReset) {
if (preservePrompt) {
// Clear screen, but preserve the current line and X position
scrollUp(0, _cuY);
_cuY = 0;
if (_hasGraphics) {
......@@ -821,7 +823,6 @@ void Screen::reset(bool softReset, bool preservePrompt)
// Other terminal emulators reset the entire scroll history during a reset
// setScroll(getScroll(), false);
setDefaultRendition();
saveCursor();
// DECSTR homes the saved cursor even though it doesn't home the current cursor
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment