summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/osh/osh.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.bin/osh/osh.c b/usr.bin/osh/osh.c
index aaa4502..db8865d 100644
--- a/usr.bin/osh/osh.c
+++ b/usr.bin/osh/osh.c
@@ -56,6 +56,7 @@
"kfg - Start up kfgwm\n" \
"bell - Toggle backspace bell\n" \
"time - Get the current time\n" \
+ "clear - Clear the screen\n" \
"exit - Exit the shell"
#define PROMPT "[root::osmora]~ "
@@ -106,6 +107,12 @@ cmd_echo(int argc, char *argv[])
}
static void
+cmd_clear(int argc, char *argv[])
+{
+ fputs("\033[H", stdout);
+}
+
+static void
cmd_bell(int argc, char *argv[])
{
const char *usage_str = "usage: bell [on/off]";
@@ -243,6 +250,7 @@ struct builtin_cmd cmds[] = {
{"reboot",cmd_reboot},
{"shutdown", cmd_shutdown},
{"bell", cmd_bell},
+ {"clear", cmd_clear},
{NULL, NULL}
};