Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ROW.Reset in EraseInDisplay instead of printing millions of spaces per line #2197

Merged
merged 1 commit into from
Aug 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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