Magellan Linux

Contents of /trunk/mkinitrd-magellan/busybox/console-tools/reset.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (show annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 8 months ago) by niro
File MIME type: text/plain
File size: 781 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

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 "busybox.h"
17
18 int reset_main(int argc, char **argv)
19 {
20 if (isatty(1)) {
21 /* See 'man 4 console_codes' for details:
22 * "ESC c" -- Reset
23 * "ESC ( K" -- Select user mapping
24 * "ESC [ J" -- Erase display
25 * "ESC [ 0 m" -- Reset all display attributes
26 * "ESC [ ? 25 h" -- Make cursor visible.
27 */
28 printf("\033c\033(K\033[J\033[0m\033[?25h");
29 }
30 return EXIT_SUCCESS;
31 }
32