diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 18:07:31 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 18:07:54 +1000 |
commit | 3bc78ad7df40a9d2787d7dd7f79a5d3257d619e4 (patch) | |
tree | 15e7eb8c058647cb5ede57e6840a7be7cb6074d2 | |
parent | 1a6d1cbfb455e71208017039d41fe7e62a69cda2 (diff) | |
download | busybox-w32-3bc78ad7df40a9d2787d7dd7f79a5d3257d619e4.tar.gz busybox-w32-3bc78ad7df40a9d2787d7dd7f79a5d3257d619e4.tar.bz2 busybox-w32-3bc78ad7df40a9d2787d7dd7f79a5d3257d619e4.zip |
win32: winansi: implement \033[H (no param)
-rw-r--r-- | win32/winansi.c | 16 |
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 | ||
125 | static 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 | |||
125 | static const char *set_attr(const char *str) | 137 | static 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; |