From 4bb140e1cc68575db7c4b4b5ce339650a56c72d0 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 4 Mar 2012 16:43:12 -0600 Subject: [PATCH] Add clear. --- toys/clear.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 toys/clear.c diff --git a/toys/clear.c b/toys/clear.c new file mode 100644 index 0000000..8cfceff --- /dev/null +++ b/toys/clear.c @@ -0,0 +1,23 @@ +/* vi: set sw=4 ts=4: + * + * clear.c - clear the screen + * + * Copyright 2012 Rob Landley + * + * Not in SUSv4. + +USE_CLEAR(NEWTOY(clear, NULL, TOYFLAG_USR|TOYFLAG_BIN)) + +config CLEAR + bool "clear" + default y + help + Clear the screen. +*/ + +#include "toys.h" + +void clear_main(void) +{ + write(1, "\e[2J\e[H", 7); +} -- 2.7.4