diff options
Diffstat (limited to '')
-rw-r--r-- | win32/winansi.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/win32/winansi.c b/win32/winansi.c index ebe831593..d61e8a2cf 100644 --- a/win32/winansi.c +++ b/win32/winansi.c | |||
@@ -122,7 +122,25 @@ static void erase_till_end_of_screen(void) | |||
122 | &dummy); | 122 | &dummy); |
123 | FillConsoleOutputAttribute(console, plain_attr, len, sbi.dwCursorPosition, | 123 | FillConsoleOutputAttribute(console, plain_attr, len, sbi.dwCursorPosition, |
124 | &dummy); | 124 | &dummy); |
125 | } | ||
126 | |||
127 | void reset_screen(void) | ||
128 | { | ||
129 | CONSOLE_SCREEN_BUFFER_INFO sbi; | ||
130 | COORD pos; | ||
131 | DWORD dummy, len; | ||
125 | 132 | ||
133 | if (!console) | ||
134 | return; | ||
135 | |||
136 | /* move to start of screen buffer and clear it all */ | ||
137 | GetConsoleScreenBufferInfo(console, &sbi); | ||
138 | pos.X = 0; | ||
139 | pos.Y = 0; | ||
140 | SetConsoleCursorPosition(console, pos); | ||
141 | len = sbi.dwSize.X * sbi.dwSize.Y; | ||
142 | FillConsoleOutputCharacterA(console, ' ', len, pos, &dummy); | ||
143 | FillConsoleOutputAttribute(console, plain_attr, len, pos, &dummy); | ||
126 | } | 144 | } |
127 | 145 | ||
128 | void move_cursor_row(int n) | 146 | void move_cursor_row(int n) |