From e8ee6096339c6226ee776a945a271a023b8fe0f8 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 8 Feb 2012 14:03:10 +0000 Subject: Implement clear command for Windows console --- console-tools/clear.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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; int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) { /* home; clear to the end of screen */ +#if !ENABLE_PLATFORM_MINGW32 return full_write1_str("\033[H""\033[J") != 6; +#else + int ret; + + ret = printf("\033[H\033[J"); + fflush(stdout); + + return ret != 6; +#endif } -- cgit v1.2.3-55-g6feb