aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/winansi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/win32/winansi.c b/win32/winansi.c
index 3e97779cb..568f925aa 100644
--- a/win32/winansi.c
+++ b/win32/winansi.c
@@ -122,6 +122,18 @@ static void move_cursor_back(int n)
122 SetConsoleCursorPosition(console, sbi.dwCursorPosition); 122 SetConsoleCursorPosition(console, sbi.dwCursorPosition);
123} 123}
124 124
125static void move_cursor(int x, int y)
126{
127 COORD pos;
128
129 if (!console)
130 return;
131
132 pos.X = x;
133 pos.Y = y;
134 SetConsoleCursorPosition(console, pos);
135}
136
125static const char *set_attr(const char *str) 137static const char *set_attr(const char *str)
126{ 138{
127 const char *func; 139 const char *func;
@@ -263,6 +275,10 @@ static const char *set_attr(const char *str)
263 case 'D': 275 case 'D':
264 move_cursor_back(strtol(str, (char **)&str, 10)); 276 move_cursor_back(strtol(str, (char **)&str, 10));
265 break; 277 break;
278 case 'H':
279 if (!len)
280 move_cursor(0, 0);
281 break;
266 case 'J': 282 case 'J':
267 erase_till_end_of_screen(); 283 erase_till_end_of_screen();
268 break; 284 break;