Skip to content

Commit

Permalink
Workaround for microsoft/terminal#32
Browse files Browse the repository at this point in the history
  • Loading branch information
t5mat committed Dec 21, 2021
1 parent fea52fb commit 047ad7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions turnbinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ struct ConsoleOutput :
FillConsoleOutputCharacterW(handle, c, count, position, &written);
}

void fill_attribute(WORD attribute, COORD position, size_t count)
{
DWORD written;
FillConsoleOutputAttribute(handle, attribute, count, position, &written);
}

void write(const wchar_t *s, size_t count)
{
WriteConsoleW(handle, s, count, nullptr, nullptr);
Expand Down Expand Up @@ -1014,6 +1020,8 @@ struct Console
out.set_cursor_info(info);
}

out.fill_attribute(0, {0, 0}, info.dwSize.X * info.dwSize.Y);

out.set_cursor_position(info.dwCursorPosition = {0, 0});
out.fill(L' ', info.dwCursorPosition, info.dwSize.X - info.dwCursorPosition.X);

Expand Down

0 comments on commit 047ad7f

Please sign in to comment.