From 3bc78ad7df40a9d2787d7dd7f79a5d3257d619e4 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Tue, 14 Sep 2010 18:07:31 +1000 Subject: win32: winansi: implement \033[H (no param) --- win32/winansi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) SetConsoleCursorPosition(console, sbi.dwCursorPosition); } +static void move_cursor(int x, int y) +{ + COORD pos; + + if (!console) + return; + + pos.X = x; + pos.Y = y; + SetConsoleCursorPosition(console, pos); +} + static const char *set_attr(const char *str) { const char *func; @@ -263,6 +275,10 @@ static const char *set_attr(const char *str) case 'D': move_cursor_back(strtol(str, (char **)&str, 10)); break; + case 'H': + if (!len) + move_cursor(0, 0); + break; case 'J': erase_till_end_of_screen(); break; -- cgit v1.2.3-55-g6feb