CE add cls command
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m32s

This commit is contained in:
2026-03-09 18:06:45 +01:00
parent 1ef028f919
commit 814c849462

View File

@@ -17,7 +17,9 @@
#include <str_status.h>
#include <string.h>
#include <system.h>
#include <tcursor.h>
#include <terminal.h>
#include <tscreen.h>
static bool run = true;
@@ -268,6 +270,8 @@ static void quit1 (struct context* context) {
interp_shutdown ();
}
static void cls (struct context* context) { cprintf (context, ANSIQ_CUR_HOME ANSIQ_SCR_CLR_ALL); }
static void help (struct context* context) {
cprintf (context, "Available commands:\n");
cprintf (context, "help\n");
@@ -279,6 +283,7 @@ static void help (struct context* context) {
cprintf (context, "rm <path>\n");
cprintf (context, "edit <path>\n");
cprintf (context, "terminfo\n");
cprintf (context, "cls\n");
cprintf (context, "quit\n");
}
@@ -317,6 +322,8 @@ static void execute_cmd (struct ast_cmd* cmd, struct context* context) {
edit (context, cmd->args[0]);
} else if (strcmp (cmd->name, "terminfo") == 0) {
terminfo (context);
} else if (strcmp (cmd->name, "cls") == 0) {
cls (context);
} else {
char volume[VOLUME_MAX];
const char* path;