_cls.c

nightmare3_fluffos_v2/lib/cmds/mortal/_cls.c · 663 B

From the archive nightmare3_fluffos_v2.zip

Download the archive   « Back to the archive contents

//	/bin/user/_cls.c
//	from the Nightmare mudlib
//	Command to clear the screen for terminals with ANSI code support
//	created by Otto@Nightmare 07 march 1993


#define CLS ESC+"[H"+ESC+"[2J"

#include <std.h>

inherit DAEMON;

int cmd_cls() {
    string str;

    if((str = (string)this_player()->getenv("TERM")) != "ansi" &&
      str != "xterm" && str != "ansi-status") {
	notify_fail("You do not have ansi set.  Try <help ansi>.\n");
	return 0;
    }
    message("prompt", "%^INITTERM%^", this_player());
    return 1;
}

void help() {
    write("Syntax: <cls>\n\nClears the screen for players who have terminals\n"+
	"that support ANSI escape codes.\n");
}

Site Stats

Snippets: 1791
Codebases: 571