Skip to content

Commit

Permalink
Use ROW.Reset in EraseInDisplay instead of printing millions of space…
Browse files Browse the repository at this point in the history
…s per line microsoft#2197
  • Loading branch information
PankajBhojwani authored Aug 1, 2019
1 parent f8f0798 commit 0da13cd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/cascadia/TerminalCore/TerminalApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0da13cd

Please sign in to comment.