usage.c: remove reference to busybox.h
[oweals/busybox.git] / console-tools / reset.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * Mini reset implementation for busybox
4  *
5  * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6  * Written by Erik Andersen and Kent Robotti <robotti@metconnect.com>
7  *
8  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
9  */
10
11 /* no options, no getopt */
12
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <unistd.h>
16 #include "libbb.h"
17
18 int reset_main(int argc, char **argv);
19 int reset_main(int argc, char **argv)
20 {
21         if (isatty(1)) {
22                 /* See 'man 4 console_codes' for details:
23                  * "ESC c"                      -- Reset
24                  * "ESC ( K"            -- Select user mapping
25                  * "ESC [ J"            -- Erase display
26                  * "ESC [ 0 m"          -- Reset all display attributes
27                  * "ESC [ ? 25 h"       -- Make cursor visible.
28                  */
29                 printf("\033c\033(K\033[J\033[0m\033[?25h");
30         }
31         return EXIT_SUCCESS;
32 }
33