diff options
| author | Ron Yorston <rmy@pobox.com> | 2012-02-08 14:03:10 +0000 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2012-02-08 14:03:10 +0000 |
| commit | e8ee6096339c6226ee776a945a271a023b8fe0f8 (patch) | |
| tree | b1d1d3bc571a4b8527e4b377170154c1fdfeb5c3 | |
| parent | 7968631c512dc2d22fb63945e9619d705d21108f (diff) | |
| download | busybox-w32-TIG.tar.gz busybox-w32-TIG.tar.bz2 busybox-w32-TIG.zip | |
Implement clear command for Windows consoleTIG
| -rw-r--r-- | console-tools/clear.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/console-tools/clear.c b/console-tools/clear.c index dcb9bfb02..da5e381b8 100644 --- a/console-tools/clear.c +++ b/console-tools/clear.c | |||
| @@ -12,5 +12,14 @@ int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | |||
| 12 | int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) | 12 | int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) |
| 13 | { | 13 | { |
| 14 | /* home; clear to the end of screen */ | 14 | /* home; clear to the end of screen */ |
| 15 | #if !ENABLE_PLATFORM_MINGW32 | ||
| 15 | return full_write1_str("\033[H""\033[J") != 6; | 16 | return full_write1_str("\033[H""\033[J") != 6; |
| 17 | #else | ||
| 18 | int ret; | ||
| 19 | |||
| 20 | ret = printf("\033[H\033[J"); | ||
| 21 | fflush(stdout); | ||
| 22 | |||
| 23 | return ret != 6; | ||
| 24 | #endif | ||
| 16 | } | 25 | } |
