From d9a3e89f501800c3e7c779b7e9545a5c80134593 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 16 May 2010 23:42:13 +0200 Subject: consolidate ESC sequences function old new delta bell 2 - -2 CMdown 2 - -2 Ceos 4 - -4 Ceol 4 - -4 CMup 4 - -4 SOs 5 - -5 SOn 5 - -5 CMrc 9 - -9 Signed-off-by: Denys Vlasenko --- console-tools/clear.c | 3 ++- console-tools/reset.c | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'console-tools') diff --git a/console-tools/clear.c b/console-tools/clear.c index 8b727b39b..b0c6d65d2 100644 --- a/console-tools/clear.c +++ b/console-tools/clear.c @@ -15,5 +15,6 @@ int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) { - return printf("\033[H\033[J") != 6; + /* home; clear to the end of screen */ + return printf("\033[H""\033[J") != 6; } diff --git a/console-tools/reset.c b/console-tools/reset.c index 6917eda42..f0ea5cb20 100644 --- a/console-tools/reset.c +++ b/console-tools/reset.c @@ -28,11 +28,11 @@ int reset_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) if (isatty(STDIN_FILENO) && isatty(STDOUT_FILENO)) { /* See 'man 4 console_codes' for details: - * "ESC c" -- Reset - * "ESC ( K" -- Select user mapping - * "ESC [ J" -- Erase display - * "ESC [ 0 m" -- Reset all display attributes - * "ESC [ ? 25 h" -- Make cursor visible. + * "ESC c" -- Reset + * "ESC ( K" -- Select user mapping + * "ESC [ J" -- Erase to the end of screen + * "ESC [ 0 m" -- Reset all display attributes + * "ESC [ ? 25 h" -- Make cursor visible */ printf("\033c\033(K\033[J\033[0m\033[?25h"); /* http://bugs.busybox.net/view.php?id=1414: -- cgit v1.2.3