projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a30a84a
)
Add clear.
author
Rob Landley
<rob@landley.net>
Sun, 4 Mar 2012 22:43:12 +0000
(16:43 -0600)
committer
Rob Landley
<rob@landley.net>
Sun, 4 Mar 2012 22:43:12 +0000
(16:43 -0600)
toys/clear.c
[new file with mode: 0644]
patch
|
blob
diff --git a/toys/clear.c
b/toys/clear.c
new file mode 100644
(file)
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 <rob@landley.net>
+ *
+ * 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);
+}