Skip to content

Commit 2096fa5

Browse files
PankajBhojwaniminiksa
PankajBhojwani
authored andcommitted
Use ROW.Reset in EraseInDisplay instead of printing millions of spaces per line #2197
1 parent a08666b commit 2096fa5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/cascadia/TerminalCore/TerminalApi.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,9 @@ bool Terminal::EraseInDisplay(const DispatchTypes::EraseType eraseType)
337337
// and we have to make sure we erase that text
338338
auto eraseStart = _mutableViewport.Height();
339339
auto eraseEnd = _buffer->GetLastNonSpaceCharacter(_mutableViewport).Y;
340-
auto eraseIter = OutputCellIterator(UNICODE_SPACE, _buffer->GetCurrentAttributes(), _mutableViewport.RightInclusive() * (eraseEnd - eraseStart + 1));
341340
for (SHORT i = eraseStart; i <= eraseEnd; i++)
342341
{
343-
COORD erasePos{ 0, i };
344-
_buffer->Write(eraseIter, erasePos);
342+
_buffer->GetRowByOffset(i).Reset(_buffer->GetCurrentAttributes());
345343
}
346344

347345
// Reset the scroll offset now because there's nothing for the user to 'scroll' to

0 commit comments

Comments
 (0)