blob: dcb9bfb02a875d48ddca210511fb96088675480a [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 */
Denis Vlasenkob6adbf12007-05-26 19:00:18 +00009#include "libbb.h"
Eric Andersencc8ed391999-10-05 16:24:54 +000010
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +000011int clear_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000012int clear_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
Eric Andersencc8ed391999-10-05 16:24:54 +000013{
Denys Vlasenkod9a3e892010-05-16 23:42:13 +020014 /* home; clear to the end of screen */
Denys Vlasenko729ecb82010-06-07 14:14:26 +020015 return full_write1_str("\033[H""\033[J") != 6;
Eric Andersencc8ed391999-10-05 16:24:54 +000016}