blob: ac22b787e84e829a183d83ba3f677f5534cf8d3f [file] [log] [blame]
Erik Andersene49d5ec2000-02-08 19:58:47 +00001/* vi: set sw=4 ts=4: */
Eric Andersen2b69c401999-10-05 22:58:32 +00002/*
3 * Mini clear implementation for busybox
4 *
Eric Andersenc7bda1c2004-03-15 08:29:22 +00005 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
Eric Andersen2b69c401999-10-05 22:58:32 +00006 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02007 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Eric Andersen2b69c401999-10-05 22:58:32 +00008 */
Pere Orga55068c42011-03-27 23:42:28 +02009
10//usage:#define clear_trivial_usage
11//usage: ""
12//usage:#define clear_full_usage "\n\n"
13//usage: "Clear screen"
14
Denis Vlasenkob6adbf12007-05-26 19:00:18 +000015#include "libbb.h"
Eric Andersencc8ed391999-10-05 16:24:54 +000016
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +000017int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000018int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
Eric Andersencc8ed391999-10-05 16:24:54 +000019{
Denys Vlasenkod9a3e892010-05-16 23:42:13 +020020 /* home; clear to the end of screen */
Denys Vlasenko729ecb82010-06-07 14:14:26 +020021 return full_write1_str("\033[H""\033[J") != 6;
Eric Andersencc8ed391999-10-05 16:24:54 +000022}