From 2096fa5e1f1f135926f3b045f4227bd04b626917 Mon Sep 17 00:00:00 2001 From: PankajBhojwani Date: Thu, 1 Aug 2019 13:19:22 -0700 Subject: [PATCH] Use ROW.Reset in EraseInDisplay instead of printing millions of spaces per line #2197 --- src/cascadia/TerminalCore/TerminalApi.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cascadia/TerminalCore/TerminalApi.cpp b/src/cascadia/TerminalCore/TerminalApi.cpp index a0504164088..8aad5abc010 100644 --- a/src/cascadia/TerminalCore/TerminalApi.cpp +++ b/src/cascadia/TerminalCore/TerminalApi.cpp @@ -337,11 +337,9 @@ bool Terminal::EraseInDisplay(const DispatchTypes::EraseType eraseType) // and we have to make sure we erase that text auto eraseStart = _mutableViewport.Height(); auto eraseEnd = _buffer->GetLastNonSpaceCharacter(_mutableViewport).Y; - auto eraseIter = OutputCellIterator(UNICODE_SPACE, _buffer->GetCurrentAttributes(), _mutableViewport.RightInclusive() * (eraseEnd - eraseStart + 1)); for (SHORT i = eraseStart; i <= eraseEnd; i++) { - COORD erasePos{ 0, i }; - _buffer->Write(eraseIter, erasePos); + _buffer->GetRowByOffset(i).Reset(_buffer->GetCurrentAttributes()); } // Reset the scroll offset now because there's nothing for the user to 'scroll' to